1)报错一
docker-compose -f compose/app.yaml -f compose/backend.yaml -f compose/proxy.yaml build peatio barong
ERROR: Couldn‘t connect to Docker daemon at http://localhost:4243 - is it running?
If it‘s at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
make: *** [build] Error 1
解决办法:
1)查看配置文件 [[email protected] ~]# systemctl show docker | grep FragmentPath= FragmentPath=/usr/lib/systemd/system/docker.service 然后修改/lib/systemd/system/docker.service文件 [[email protected] ~]# cp /lib/systemd/system/docker.service /lib/systemd/system/docker.service.bak [[email protected] ~]# vim /lib/systemd/system/docker.service ....... ExecStart=/usr/bin/dockerd -H unix:///var/run/docker.sock -H tcp://0.0.0.0:4243 #添加这一行 #ExecStart=/usr/bin/dockerd-current \ #注释掉默认的这一行 --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current \ --default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd --userland-proxy-path=/usr/libexec/docker/docker-proxy-current --seccomp-profile=/etc/docker/seccomp.json $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY $REGISTRIES 2)修改/etc/default/docker文件 [[email protected] ~]# cp /etc/default/docker /etc/default/docker.bak [[email protected] ~]# vim /etc/sysconfig/docker ...... DOCKER_OPTS="-H tcp://localhost:4243 -H unix:///var/run/docker.sock" #添加这一行 3)DOCKER_HOST的环境变量设置 [[email protected] ~]# vim ~/.bashrc ........ export DOCKER_HOST=tcp://localhost:4243 4)重启docker服务 [[email protected] ~]# systemctl daemon-reload [[email protected] ~]# systemctl restart docker 5)检查发现4243端口已启动 [[email protected] ~]# netstat -ant ....... tcp6 0 0 :::4243 :::* LISTEN [[email protected] ~]# lsof -i:4243 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME dockerd-c 15400 root 6u IPv6 59175 0t0 TCP *:4243 (LISTEN)
2)报错二
ERROR: Service ‘****‘ failed to build: shim error: docker-runc not installed on system
解决办法
[[email protected] ~]# cd /usr/libexec/docker/ [[email protected] ~]# ll total 7384 -rwxr-xr-x 1 root root 820472 Mar 8 01:07 docker-init-current -rwxr-xr-x 1 root root 1687304 Mar 8 01:07 docker-proxy-current -rwxr-xr-x 1 root root 5047808 Mar 8 01:07 docker-runc-current [[email protected] ~]# ln -s docker-runc-current docker-runc [[email protected] ~]# ll total 7384 -rwxr-xr-x 1 root root 820472 Mar 8 01:07 docker-init-current -rwxr-xr-x 1 root root 1687304 Mar 8 01:07 docker-proxy-current lrwxrwxrwx 1 root root 19 May 12 01:07 docker-runc -> docker-runc-current -rwxr-xr-x 1 root root 5047808 Mar 8 01:07 docker-runc-current
原文地址:https://www.cnblogs.com/kevingrace/p/9030684.html
时间: 2024-10-10 08:47:44