如何更改Docker套接字路径

时间:2018-08-28 05:42:44

标签: docker

我正在尝试将docker默认套接字文件路径更改为unix:///var/run/docker-socket/docker.sock

重新启动后,我可以看到docker服务处于运行状态,但是无法执行任何docker命令。由于系统仍在默认位置寻找套接字文件。

错误:

# docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

泊坞窗状态:

# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/etc/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: active (running) since Tue 2018-08-28 14:33:07 AEST; 42min ago
     Docs: http://docs.docker.com
 Main PID: 32405 (sh)
    Tasks: 22
   Memory: 18.1M
   CGroup: /system.slice/docker.service
           ├─32405 /bin/sh -c /usr/bin/docker daemon            --exec-opt native.cgroupdriver=systemd            $OPTIONS            $DOCKER_ULIMITS            $DOCKER_STORAGE_OPTIONS            $DOCKER_NETWORK_OPTIONS            $A...
           ├─32406 dockerd --exec-opt native.cgroupdriver=systemd -H unix:///var/run/docker-socket/docker.sock -H tcp://0.0.0.0:2376

0 个答案:

没有答案