执行命令:
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)