Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] 修改Docker仓库导致docker崩溃 #4959

Closed
ylwind opened this issue May 10, 2024 · 10 comments
Closed

[BUG] 修改Docker仓库导致docker崩溃 #4959

ylwind opened this issue May 10, 2024 · 10 comments
Assignees

Comments

@ylwind
Copy link

ylwind commented May 10, 2024

联系方式

zhang@ripic.site

1Panel 版本

1.10.5-lts

问题描述

新增docker仓库后,修改docker仓库地址,会导致docker崩溃

重现步骤

  • 新增仓库
  • 需要认证,选择https,输入账号密码,仓库地址url
  • 修改仓库地址url
  • 崩溃

期待的正确结果

No response

相关日志输出

No response

附加信息

No response

@wanghe-fit2cloud
Copy link
Member

docker 崩溃 是指的 docker 服务运行异常吗?
使用如下命令查看一下详细日志,看是否有 Error 相关信息:

journalctl -u docker.service -exf

@ylwind
Copy link
Author

ylwind commented May 10, 2024

-- Subject: A start job for unit docker.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit docker.service has finished with a failure.
-- 
-- The job identifier is 1099 and the job result is failed.
May 10 16:45:34 1panel systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Automatic restarting of the unit docker.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
May 10 16:45:34 1panel systemd[1]: Stopped Docker Application Container Engine.
-- Subject: A stop job for unit docker.service has finished
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A stop job for unit docker.service has finished.
-- 
-- The job identifier is 1162 and the job result is done.
May 10 16:45:34 1panel systemd[1]: docker.service: Start request repeated too quickly.
May 10 16:45:34 1panel systemd[1]: docker.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit docker.service has entered the 'failed' state with result 'exit-code'.
May 10 16:45:34 1panel systemd[1]: Failed to start Docker Application Container Engine.

后面清理了/etc/docker/daemon.json恢复

@wanghe-fit2cloud
Copy link
Member

后面清理了/etc/docker/daemon.json恢复

可以再重试一次,截图发一下 daemon.json 配置文件。

@ylwind
Copy link
Author

ylwind commented May 10, 2024

daemon.json

{
        "insecure-registries": [
                "registry.cn-beijing.aliyuncs.com/{example1}"
        ],
        "live-restore": true,
        "log-driver": "json-file",
        "log-opts": {
                "max-file": "3",
                "max-size": "10m"
        },
        "registry-mirrors": [
                "https://{example2}.mirror.aliyuncs.com"
        ]
}

{example1} {example2} 为敏感信息,都是字母

@ylwind
Copy link
Author

ylwind commented May 10, 2024

然而实际上,编辑过程中选择的是https,按理不应该增加insecure-registries
docker版本如下

Client: Docker Engine - Community
 Version:    26.0.0
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.13.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.25.0
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

@wanghe-fit2cloud
Copy link
Member

然而实际上,编辑过程中选择的是https,按理不应该增加insecure-registries docker版本如下

删除仓库,然后重新添加时协议选择 https

@ylwind
Copy link
Author

ylwind commented May 10, 2024

从始至终,始终选择的都是https,不过依旧会增加insecure-registries

@wanghe-fit2cloud
Copy link
Member

从始至终,始终选择的都是https,不过依旧会增加insecure-registries

在本地环境测试添加 https 仓库,未发现会增加 insecure-registries 配置的问题。

编辑仓库从 http 协议切换至 https 时,确实未同步修改 daemon.json 文件。

@ylwind
Copy link
Author

ylwind commented May 10, 2024

已申请添加企微,我这边演示一下

@wanghe-fit2cloud
Copy link
Member

先关闭该 issue 了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants