0
Dockerバージョン1.12のsystemdをポート2375で待機するように設定しました。その結果、Dockerデーモンがソケットに接続されています:2375
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network.target
[Service]
Type=notify
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375
ExecReload=/bin/kill -s HUP
MountFlags=slave
LimitNOFILE=1048576
LimitNPROC=1048576
LimitCORE=infinity
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
[Install]
WantedBy=multi-user.target
:
*tcp6 0 0 :::2375 :::* LISTEN*
私は上ドッカーを実行しているホストのターミナルで「ドッカ」コマンドを使用しようとすると、しかし、私は以下のようになります。
[[email protected] ~]# docker images
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
Even though the docker.service is actually running:
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2016-12-30 14:50:53 AEDT; 1min 32s ago
Docs: https://docs.docker.com
Main PID: 4976 (dockerd)
Memory: 21.1M
CGroup: /system.slice/docker.service
├─4976 /usr/bin/dockerd -H tcp://0.0.0.0:2375
└─4982 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --shim docker-containerd-shim --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --runtime do...
Dec 30 14:50:52 docker1-12 dockerd[4976]: time="2016-12-30T14:50:52.083736426+11:00" level=info msg="[graphdriver] using prior storage driver \"devicemapper\""
Dec 30 14:50:52 docker1-12 dockerd[4976]: time="2016-12-30T14:50:52.091254467+11:00" level=info msg="Graph migration to content-addressability took 0.00 seconds"
Dec 30 14:50:52 docker1-12 dockerd[4976]: time="2016-12-30T14:50:52.095445562+11:00" level=info msg="Loading containers: start."
Dec 30 14:50:52 docker1-12 dockerd[4976]: time="2016-12-30T14:50:52.128643621+11:00" level=info msg="Firewalld running: true"
Dec 30 14:50:52 docker1-12 dockerd[4976]: time="2016-12-30T14:50:52.919797126+11:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address"
Dec 30 14:50:53 docker1-12 dockerd[4976]: time="2016-12-30T14:50:53.274835533+11:00" level=info msg="Loading containers: done."
Dec 30 14:50:53 docker1-12 dockerd[4976]: time="2016-12-30T14:50:53.275468481+11:00" level=info msg="Daemon has completed initialization"
Dec 30 14:50:53 docker1-12 dockerd[4976]: time="2016-12-30T14:50:53.275501250+11:00" level=info msg="Docker daemon" commit=7392c3b graphdriver=devicemapper version=1.12.5
Dec 30 14:50:53 docker1-12 dockerd[4976]: time="2016-12-30T14:50:53.285288956+11:00" level=info msg="API listen on [::]:2375"
Dec 30 14:50:53 docker1-12 systemd[1]: Started Docker Application Container Engine.
どうすればこの問題を解決できますか?すなわち、ホスト上でローカルにドッカーコマンドを実行できる間に、ドックがポート:2375でリッスンしていますか?
回避策として、次の構成が見つかりました。あなたは、
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock
この方法:
1.Changeあなたsystemd
ユニットファイル:私は2つのオプションを考えることができ
Environment="DOCKER_OPTS=-H tcp://0.0.0.0:2375 --exec-opt native.cgroupdriver=cgroupfs"
ExecStart=/usr/bin/docker daemon -H fd:// \$DOCKER_OPTS
はあなたに@Farhad Farahi、先生ありがとうございました。 2番目の方法は魅力的に機能しました。私は0.0.0.0:2375をno_proxyの/ etc/environmentに追加しました。私はこのインスタンスでプロキシを使用しています。あなたの助けをもう一度ありがとう。 – SSF