docker重啟後啟動失敗Failed to start Docker Application Container Engine.
阿新 • • 發佈:2019-01-06
剛剛弄了docker重啟了一下,本來啟動得好好的,重啟系統後就不行了
一直給我報錯
最開始是這樣的
[[email protected] run]# systemctl status docker ● docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Thu 2017-12-14 10:56:34 EST; 2min 38s ago Docs: http://docs.docker.com Process: 10755 ExecStart=/usr/bin/docker-current daemon --exec-opt native.cgroupdriver=systemd $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY (code=exited, status=1/FAILURE) Main PID: 10755 (code=exited, status=1/FAILURE) Dec 14 10:56:33 server systemd[1]: Starting Docker Application Container Engine... Dec 14 10:56:33 server docker-current[10755]: time="2017-12-14T10:56:33.627099954-05:00" level=warning msg="devmapper: Usage of loopback devices is strongly discou...v section." Dec 14 10:56:33 server docker-current[10755]: time="2017-12-14T10:56:33.643888204-05:00" level=info msg="devmapper: Creating filesystem xfs on device docker-253:0-...61896-base" Dec 14 10:56:34 server docker-current[10755]: time="2017-12-14T10:56:34.163161282-05:00" level=info msg="devmapper: Successfully created filesystem xfs on device d...61896-base" Dec 14 10:56:34 server docker-current[10755]: time="2017-12-14T10:56:34.290819345-05:00" level=warning msg="Docker could not enable SELinux on the host system" Dec 14 10:56:34 server docker-current[10755]: time="2017-12-14T10:56:34.325390849-05:00" level=fatal msg="Error starting daemon: Error loading key file /etc/docker...ON input\n" Dec 14 10:56:34 server systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE Dec 14 10:56:34 server systemd[1]: Failed to start Docker Application Container Engine. Dec 14 10:56:34 server systemd[1]: Unit docker.service entered failed state. Dec 14 10:56:34 server systemd[1]: docker.service failed. Hint: Some lines were ellipsized, use -l to show in full.
給我提示 msg="Error starting daemon: Error loading key file /etc/docker...ON input\n"
我開始也沒有在意,一直在用網上的方法試什麼刪除/var/run/docker.sock,或者是刪除rm -rf /var/lib/docker/
最著不住的是居然看見有人說再重啟系統後就能成功,簡直是。。。。可怕!!
當然以上都沒有成功。。。
然後報錯資訊突然變了
level=fatal msg="Error starting daemon: Error loading key file /etc/docker/key.json: unable to decode pr... JSON input\n"[[email protected] ~]# systemctl status docker ● docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Thu 2017-12-14 11:10:24 EST; 36s ago Docs: http://docs.docker.com Process: 2403 ExecStart=/usr/bin/docker-current daemon --exec-opt native.cgroupdriver=systemd $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY (code=exited, status=1/FAILURE) Main PID: 2403 (code=exited, status=1/FAILURE) Dec 14 11:10:24 server systemd[1]: Starting Docker Application Container Engine... Dec 14 11:10:24 server docker-current[2403]: time="2017-12-14T11:10:24.532194806-05:00" level=warning msg="devmapper: Usage of loopback devices is strongly discouraged for production use. Plea...ldev section." Dec 14 11:10:24 server docker-current[2403]: time="2017-12-14T11:10:24.547180234-05:00" level=warning msg="devmapper: Base device already exists and has filesystem xfs on it. User specified fi...l be ignored." Dec 14 11:10:24 server docker-current[2403]: time="2017-12-14T11:10:24.554895833-05:00" level=info msg="[graphdriver] using prior storage driver \"devicemapper\"" Dec 14 11:10:24 server docker-current[2403]: time="2017-12-14T11:10:24.555289136-05:00" level=warning msg="Docker could not enable SELinux on the host system" Dec 14 11:10:24 server docker-current[2403]: time="2017-12-14T11:10:24.885244154-05:00" level=fatal msg="Error starting daemon: Error loading key file /etc/docker/key.json: unable to decode pr... JSON input\n" Dec 14 11:10:24 server systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE Dec 14 11:10:24 server systemd[1]: Failed to start Docker Application Container Engine. Dec 14 11:10:24 server systemd[1]: Unit docker.service entered failed state. Dec 14 11:10:24 server systemd[1]: docker.service failed. Hint: Some lines were ellipsized, use -l to show in full.
我去這次顯示得如此清楚,以前的那個我就沒有注意看。。。
解決方法:當然是刪除key.json
[[email protected] run]# rm /etc/docker/key.json rm: remove regular empty file ‘/etc/docker/key.json’? y [[email protected] run]# systemctl start docker.service
本來我以為我寫完了,然後我發現我另外幾臺刪了也啟動不了。。。
請把rm -rf /var/lib/docker/一併刪除
[[email protected] ~]# rm /etc/docker/key.json
rm: remove regular empty file ‘/etc/docker/key.json’? y
[[email protected] ~]# systemctl restart docker
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
[[email protected] ~]# rm -rf /var/lib/docker/
[[email protected] ~]# systemctl restart docker
解決問題,看來以後得多注意下細節