docker build失败error creating overlay mount to /var/lib/docker/overlay2/XX/merged: invalid argument
error creating overlay mount to /var/lib/docker/overlay2/XX/merged: invalid argument
I forgot to take a screenshot here, it’s just a reminder.
Let me talk about the reason, because selinux is turned on before starting docker, and selinux is turned off after the server restarts, so the docker container thinks that selinux does not match the host and fails to start.
vim /etc/sysconfig/docker
I first change OPTIONS='--selinux-enabled to OPTIONS='--selinux-enabled=false
Restart systemctl restart docker At this time, docker is no problem to start.
Then modify vim /var/lib/docker/containers/xx/config.v2.json
Change "MountLabel": "system_u:object_r:svirt_sandbox_file_t:s0:c12,c257", "ProcessLabel": "system_u:system_r:svirt_lxc_net_t:s0:c12,c257"
the rebuild to "MountLabel": "", "ProcessLabel": ""
, then restart the docker daemon, and the container will be repaired.
Another problem after restarting
This container has been restarting, and the printing log is also insufficient permission
directory that will be mapped
chown 1000.1000 jenkins_home to reauthorize to docker
problem solving