linux – docker docker.service的作业失败,因为控制进程退出并显示错误代码

前端之家收集整理的这篇文章主要介绍了linux – docker docker.service的作业失败,因为控制进程退出并显示错误代码前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我花了更多的时间在这里和外面学习很多帖子,但我找不到解决方案,所以我来到这里问:

我想在manjaro linux OS上运行docker(像archlinux一样)

  1. uname -a
  2. Linux boblinux-pc 4.1.15-1-MANJARO #1 SMP PREEMPT Tue Dec 15 07:48:44 UTC 2015 x86_64 GNU/Linux

安装docker之后,我想开始它:

  1. sudo systemctl start docker
  2. Failed to start docker.service: Unit docker.socket Failed to load: No such file or directory.

所以我有这个问题,所以我做了:

  1. systemctl cat docker
  2. # /etc/systemd/system/docker.service
  3. [Unit]
  4. Description=Docker Application Container Engine
  5. Documentation=https://docs.docker.com
  6. After=network.target docker.socket
  7. Requires=docker.socket
  8. [Service]
  9. Type=notify
  10. ExecStart=/usr/bin/docker daemon -H fd:// --exec-opt native.cgroupdriver=cgroupf
  11. MountFlags=slave
  12. LimitNOFILE=1048576
  13. LimitNPROC=1048576
  14. LimitCORE=infinity
  15. [Install]
  16. WantedBy=multi-user.target
  17. # /etc/systemd/system/docker.service.d/lxc.conf
  18. [Service]
  19. ExecStart=
  20. ExecStart=/usr/bin/docker -d -e lxc
  21. ....

我做了:

  1. systemctl cat docker.socket
  2. # /usr/lib/systemd/system/docker.socket
  3. [Unit]
  4. Description=Docker Socket for the API
  5. PartOf=docker.service
  6. [Socket]
  7. ListenStream=/var/run/docker.sock
  8. SocketMode=0660
  9. SocketUser=root
  10. SocketGroup=docker
  11. [Install]
  12. WantedBy=sockets.target

好的,所以安装似乎没问题,所以错误消息说我执行这个:

  1. systemctl status docker.service
  2. docker.service - Docker Application Container Engine
  3. Loaded: loaded (/etc/systemd/system/docker.service; enabled; vendor preset: disabled)
  4. Drop-In: /etc/systemd/system/docker.service.d
  5. └─lxc.conf
  6. Active: Failed (Result: exit-code) since jeu. 2016-01-07 13:34:44 CET; 2min 0s ago
  7. Docs: https://docs.docker.com
  8. Process: 1970 ExecStart=/usr/bin/docker -d -e lxc (code=exited,status=1/FAILURE)
  9. Main PID: 1970 (code=exited,status=1/FAILURE)
  10. janv. 07 13:34:44 boblinux-pc docker[1970]: time="2016-01-07T13:34:44.516598..."
  11. janv. 07 13:34:44 boblinux-pc docker[1970]: time="2016-01-07T13:34:44.519014..."
  12. janv. 07 13:34:44 boblinux-pc docker[1970]: time="2016-01-07T13:34:44.523254..."
  13. janv. 07 13:34:44 boblinux-pc docker[1970]: time="2016-01-07T13:34:44.538260..."
  14. janv. 07 13:34:44 boblinux-pc docker[1970]: time="2016-01-07T13:34:44.735998..."
  15. janv. 07 13:34:44 boblinux-pc docker[1970]: time="2016-01-07T13:34:44.766801..."
  16. janv. 07 13:34:44 boblinux-pc systemd[1]: docker.service: Main process exite...E
  17. janv. 07 13:34:44 boblinux-pc systemd[1]: Failed to start Docker Application Container Engine.
  18. janv. 07 13:34:44 boblinux-pc systemd[1]: docker.service: Unit entered Failed state.
  19. janv. 07 13:34:44 boblinux-pc systemd[1]: docker.service: docker.service: Failed with result 'exit-code'.
  20. Hint: Some lines were ellipsized,use -l to show in full.
  21. journalctl -xe
  22. Hint: You are currently not seeing messages from other users and the system.
  23. Users in the 'systemd-journal' group can see all messages. Pass -q to
  24. turn off this notice.
  25. janv. 07 13:34:44 boblinux-pc systemd[1]: docker.service: Main process exited,c
  26. janv. 07 13:34:44 boblinux-pc systemd[1]: Failed to start Docker Application Con
  27. -- Subject: L'unité (unit) docker.service a échoué
  28. -- Defined-By: systemd
  29. -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
  30. --
  31. -- L'unité (unit) docker.service a échoué,avec le résultat Failed.
  32. janv. 07 13:34:44 boblinux-pc systemd[1]: docker.service: Unit entered Failed st
  33. janv. 07 13:34:44 boblinux-pc systemd[1]: docker.service: Failed with result 'ex
  34. janv. 07 13:34:44 boblinux-pc sudo[1963]: pam_unix(sudo:session): session closed
  35. janv. 07 13:34:44 boblinux-pc polkitd[392]: Unregistered Authentication Agent fo
  36. janv. 07 13:35:24 boblinux-pc systemd[1]: Starting Cleanup of Temporary Director
  37. -- Subject: L'unité (unit) systemd-tmpfiles-clean.service a commencé à démarrer
  38. -- Defined-By: systemd
  39. -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
  40. --
  41. -- L'unité (unit) systemd-tmpfiles-clean.service a commencé à démarrer.
  42. janv. 07 13:35:24 boblinux-pc systemd[1]: Started Cleanup of Temporary Directori
  43. -- Subject: L'unité (unit) systemd-tmpfiles-clean.service a terminé son démarrag
  44. -- Defined-By: systemd
  45. -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
  46. --
  47. -- L'unité (unit) systemd-tmpfiles-clean.service a terminé son démarrage,avec l
  48. lines 1695-1717/1717 (END)
  49. janv. 07 13:34:44 boblinux-pc systemd[1]: docker.service: Main process exited,code=exited,status=1/FAILURE
  50. janv. 07 13:34:44 boblinux-pc systemd[1]: Failed to start Docker Application Container Engine.
  51. -- Subject: L'unité (unit) docker.service a échoué
  52. -- Defined-By: systemd
  53. -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
  54. --
  55. -- L'unité (unit) docker.service a échoué,avec le résultat Failed.
  56. janv. 07 13:34:44 boblinux-pc systemd[1]: docker.service: Unit entered Failed state.
  57. janv. 07 13:34:44 boblinux-pc systemd[1]: docker.service: Failed with result 'exit-code'.
  58. janv. 07 13:34:44 boblinux-pc sudo[1963]: pam_unix(sudo:session): session closed for user root
  59. janv. 07 13:34:44 boblinux-pc polkitd[392]: Unregistered Authentication Agent for unix-process:1964:86659 (system bus name :1.41,obje
  60. janv. 07 13:35:24 boblinux-pc systemd[1]: Starting Cleanup of Temporary Directories...
  61. -- Subject: L'unité (unit) systemd-tmpfiles-clean.service a commencé à démarrer
  62. -- Defined-By: systemd
  63. -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
  64. --
  65. -- L'unité (unit) systemd-tmpfiles-clean.service a commencé à démarrer.
  66. janv. 07 13:35:24 boblinux-pc systemd[1]: Started Cleanup of Temporary Directories.
  67. -- Subject: L'unité (unit) systemd-tmpfiles-clean.service a terminé son démarrage
  68. -- Defined-By: systemd
  69. -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
  70. --
  71. -- L'unité (unit) systemd-tmpfiles-clean.service a terminé son démarrage,avec le résultat done.

我尝试了很多东西,但我没有找到解决方案,所以,谢谢你们,如果有人可以帮助我,对不起我的英语不好,我不是英语= D

最佳答案
所以,这是管理用户/组的问题,

我尝试用sudo用docker拉ubuntu:

  1. sudo docker pull ubuntu
  2. Using default tag: latest
  3. latest: Pulling from library/ubuntu
  4. fcee8bcfe180: Pull complete
  5. 4cdc0cbc1936: Pull complete
  6. d9e545b90db8: Pull complete
  7. c4bea91afef3: Pull complete
  8. Digest: sha256:b53bb7b0d18842214ac7472c2a8801e8682c247d30f1ba4bab0083a2e2e091ea
  9. Status: Downloaded newer image for ubuntu:latest

在这里我尝试运行它,它的工作原理! :

  1. sudo docker run -it --name ubuntu ubuntu
  2. pass [sudo] de boblinux :
  3. root@3a99cdd1c522:/# ls
  4. bin dev home lib64 mnt proc run srv tmp var
  5. boot etc lib media opt root sbin sys usr
  6. root@3a99cdd1c522:/# exit
  7. exit

猜你在找的Docker相关文章