求解救:使用 docker 啟動 jenkins 遇到的問題。

渐渐發表於2020-07-16

執行命令:

sudo docker run --name qiuqiujenkins -p 8080:8080 -p 50000:50000 docker.io/jenkins/jenkins

如下報錯 1,嘗試了各種網上搜尋,百度谷歌,也查了,並沒有什麼地方埠占用了,不知道是不是因為自己找的宿主機的沒有佔用,是不是 docker 裡的 50000 埠被佔用了?在解決過程中,又嘗試了幾次,沒有了報錯 1 ,但是又來了報錯 2,簡直絕望~~

# 報錯1
/usr/bin/docker-current: Error response from daemon: driver failed programming external connectivity on endpoint qiuqiujenkins (1c1a7148ea2078f9db5c74cc9b2ec720506c046dbdfb62429b2a227a7ef1de98): Bind for 0.0.0.0:50000 failed: port is already allocated.
ERRO[0000] error getting events from daemon: net/http: request canceled
# 報錯2
/usr/bin/docker-current: Error response from daemon: failed to update store for object type *libnetwork.endpointCnt: Key not found in store.
ERRO[0000] error getting events from daemon: net/http: request canceled

後續嘗試重啟 docker

▶ sudo service docker start
Redirecting to /bin/systemctl start docker.service
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.

▶ systemctl status docker.service
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since 四 2020-07-16 18:54:33 CST; 15s ago
     Docs: http://docs.docker.com
  Process: 755 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 --init-path=/usr/libexec/docker/docker-init-current --seccomp-profile=/etc/docker/seccomp.json $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY $REGISTRIES (code=exited, status=1/FAILURE)
 Main PID: 755 (code=exited, status=1/FAILURE)

▶ sudo journalctl -xe
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit user-0.slice has finished shutting down.
7月 16 18:54:33 localhost.localdomain sudo[686]:  jfj0289 : TTY=pts/0 ; PWD=/home/jfj0289 ; USER=root ; COMMAND=/sbin/service docker start
7月 16 18:54:33 localhost.localdomain sudo[686]: pam_unix(sudo:session): session opened for user root by jfj0289(uid=0)
7月 16 18:54:33 localhost.localdomain polkitd[1008]: Registered Authentication Agent for unix-process:688:305794921 (system bus name :1.2081 [/usr/bin/pkttyagent
7月 16 18:54:33 localhost.localdomain systemd[1]: Starting Docker Storage Setup...
-- Subject: Unit docker-storage-setup.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker-storage-setup.service has begun starting up.
7月 16 18:54:33 localhost.localdomain systemd[1]: Started Docker Storage Setup.
-- Subject: Unit docker-storage-setup.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker-storage-setup.service has finished starting up.
--
-- The start-up result is done.
7月 16 18:54:33 localhost.localdomain systemd[1]: Starting Docker Application Container Engine...
-- Subject: Unit docker.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has begun starting up.
7月 16 18:54:33 localhost.localdomain dockerd-current[755]: Error starting daemon: pid file found, ensure docker is not running or delete /var/run/docker.pid
7月 16 18:54:33 localhost.localdomain systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
7月 16 18:54:33 localhost.localdomain systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has failed.
--
-- The result is failed.
7月 16 18:54:33 localhost.localdomain systemd[1]: Unit docker.service entered failed state.
7月 16 18:54:33 localhost.localdomain systemd[1]: docker.service failed.
7月 16 18:54:33 localhost.localdomain polkitd[1008]: Unregistered Authentication Agent for unix-process:688:305794921 (system bus name :1.2081, object path /org/f
7月 16 18:54:33 localhost.localdomain sudo[686]: pam_unix(sudo:session): session closed for user root
7月 16 18:55:40 localhost.localdomain sudo[822]:  jfj0289 : TTY=pts/0 ; PWD=/home/jfj0289 ; USER=root ; COMMAND=/bin/journalctl -xe
7月 16 18:55:40 localhost.localdomain sudo[822]: pam_unix(sudo:session): session opened for user root by jfj0289(uid=0)
lines 2731-2773/2773 (END)

相關文章