1Panel icon indicating copy to clipboard operation
1Panel copied to clipboard

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

Open ylwind opened this issue 1 year ago • 9 comments

联系方式

[email protected]

1Panel 版本

1.10.5-lts

问题描述

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

重现步骤

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

期待的正确结果

No response

相关日志输出

No response

附加信息

No response

ylwind avatar May 10 '24 08:05 ylwind

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

journalctl -u docker.service -exf

wanghe-fit2cloud avatar May 10 '24 10:05 wanghe-fit2cloud

-- 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恢复

ylwind avatar May 10 '24 10:05 ylwind

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

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

wanghe-fit2cloud avatar May 10 '24 14:05 wanghe-fit2cloud

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 avatar May 10 '24 14:05 ylwind

然而实际上,编辑过程中选择的是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

ylwind avatar May 10 '24 14:05 ylwind

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

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

wanghe-fit2cloud avatar May 10 '24 14:05 wanghe-fit2cloud

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

ylwind avatar May 10 '24 14:05 ylwind

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

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

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

wanghe-fit2cloud avatar May 10 '24 14:05 wanghe-fit2cloud

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

ylwind avatar May 10 '24 14:05 ylwind

先关闭该 issue 了。

wanghe-fit2cloud avatar May 20 '24 10:05 wanghe-fit2cloud