docker修改数据目录后无法创建新的容器“docker: Error response from daemon: ******open /etc/hostname:invaild arguement

操作步骤:

配置/etc/docker/daemon.json,增加如下配置:
“data-root”: “/data/docker_home”
或配置/usr/lib/systemd/system/docker.service 修改如下配置
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --graph=/data/docker_home
cp -a /var/lib/docker/* /data/docker_home/
systemctl daemon-reload
docker ps查看之前docker进程都在
执行docker run -itd nginx,报错如下

在这里插入图片描述
最后查出来是 facl权限问题,最初给数据目录设置了自动继承facl权限的属性,移除facl权限后,恢复正常:
setfacl -R -b /data/docker_home

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
This error message indicates that the Docker client is unable to communicate with the Docker daemon. The most common causes of this error include: 1. Docker daemon is not running: Make sure that the Docker daemon is running on your system. You can start it by running the command "sudo systemctl start docker" (on Linux) or "Docker Desktop" (on Windows/Mac). 2. Permissions issue: Ensure that you have the necessary permissions to access the Docker daemon. You may need to add your user to the "docker" group or use "sudo" to run Docker commands. 3. Docker daemon is not listening on the correct socket: Check that the Docker daemon is listening on the correct socket. The default socket is "/var/run/docker.sock". If the Docker daemon is listening on a different socket, you may need to update the Docker client configuration accordingly. 4. Docker daemon is not reachable: If the Docker daemon is running on a remote machine, make sure that you have configured the Docker client to connect to the correct IP address or hostname. To troubleshoot this error, you can try the following: 1. Check the Docker daemon status by running the command "sudo systemctl status docker" (on Linux) or "Docker Desktop" (on Windows/Mac). 2. Verify that you have the necessary permissions to access the Docker daemon by running the command "docker ps" with sudo or as root. 3. Check if the Docker daemon is listening on the correct socket by running the command "sudo netstat -tulpen | grep docker". 4. If you are using Docker on a remote machine, make sure that you have configured the Docker client to connect to the correct IP address or hostname. 5. Restart the Docker daemon by running the command "sudo systemctl restart docker" (on Linux) or "Docker Desktop" (on Windows/Mac). If none of these solutions work, you may need to reinstall Docker or seek further assistance from the Docker community.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值