我在docker(DinD)中有一个带有debian-11靶心的docker图像。在我的host machine
上运行命令docker info
时
# host machine
# docker info
Server:
Containers: 3
Running: 3
Paused: 0
Stopped: 0
Images: 27
Server Version: 20.10.22
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
...
...
Kernel Version: 5.15.0-56-generic
Operating System: Ubuntu 22.04.1 LTS
OSType: linux
Architecture: x86_64
但是我在DinD映像中运行了docker info
。
# DinD machine
# docker info
Server:
Containers: 1
Running: 1
Paused: 0
Stopped: 0
Images: 1
Server Version: 20.10.5+dfsg1
Storage Driver: vfs
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
...
...
Kernel Version: 5.15.0-56-generic
Operating System: Debian GNU/Linux 11 (bullseye)
OSType: linux
Architecture: x86_64
我不确定为什么DinD
容器将存储驱动器用作vfs
而不是overlay2
。在DinD
容器中。没有daemon.json的设置
# Inside DinD container (debian-11)
root@d7f083938722:/# cat /etc/docker/daemon.json
{
"data-root": "/data/var/lib/docker",
"live-restore": true,
"log-driver": "json-file",
"init": true
}
1条答案
按热度按时间xzlaal3s1#
在构建dind docker映像时。我安装了这个卷
停靠文件
因为我的daemon.json(目录/变量/库/停靠器/daemon. json)
但是在运行docker映像时,我将主机卷安装在了dinddocker容器中的错误位置
正确的运行命令应为
修复卷装载后,dind容器使用主机系统配置
overlay2