当前位置: 首页 > 知识库问答 >
问题:

使用“--重启-始终”重新启动后,docker无法启动容器

陈畅
2023-03-14

我希望容器在计算机重新启动后自动启动,所以我使用'--restart=always'标志,但它并没有像我预期的那样运行。当我重新启动系统时,容器没有启动。

$ uname  -a
Linux DebianV 4.9.0-1-amd64 #1 SMP Debian 4.9.2-2 (2017-01-12) x86_64 GNU/Linux

$ docker version
Client:
 Version:      1.13.0
 API version:  1.25
 Go version:   go1.7.3
 Git commit:   49bf474
 Built:        Tue Jan 17 09:44:08 2017
 OS/Arch:      linux/amd64

Server:
 Version:      1.13.0
 API version:  1.25 (minimum version 1.12)
 Go version:   go1.7.3
 Git commit:   49bf474
 Built:        Tue Jan 17 09:44:08 2017
 OS/Arch:      linux/amd64
 Experimental: false

$ docker info
Containers: 2
 Running: 0
 Paused: 0
 Stopped: 2
Images: 2
Server Version: 1.13.0
Storage Driver: overlay2                                                                                                                                                                                           
 Backing Filesystem: extfs                                                                                                                                                                                         
 Supports d_type: true                                                                                                                                                                                             
 Native Overlay Diff: true                                                                                                                                                                                         
Logging Driver: json-file                                                                                                                                                                                          
Cgroup Driver: cgroupfs                                                                                                                                                                                            
Plugins:                                                                                                                                                                                                           
 Volume: local                                                                                                                                                                                                     
 Network: bridge host macvlan null overlay                                                                                                                                                                         
Swarm: inactive                                                                                                                                                                                                    
Runtimes: runc                                                                                                                                                                                                     
Default Runtime: runc                                                                                                                                                                                              
Init Binary: docker-init                                                                                                                                                                                           
containerd version: 03e5862ec0d8d3b3f750e19fca3ee367e13c090e
runc version: 2f7393a47307a16f8cee44a37b262e8b81021e3e
init version: 949e6fa
Kernel Version: 4.9.0-1-amd64
Operating System: Debian GNU/Linux 9 (stretch)
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 7.708 GiB
Name: DebianV
ID: NISJ:R6JZ:VZNI:YBI7:K4ZQ:AGTR:LYSM:KORT:LQE2:RSG5:AQ6B:IEDP
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 14
 Goroutines: 21
 System Time: 2017-02-07T05:24:11.646839781-05:00
 EventsListeners: 0
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
docker run -d --restart=always --name db-mysql -e MYSQL_ROOT_PASSWORD=123456 -p 0.0.0.0:3306:3306/tcp mysql:8.0

docker日志信息

Feb 07 18:20:25 DebianV systemd[1]: Starting Docker Application Container Engine...
Feb 07 18:20:25 DebianV dockerd[641]: time="2017-02-07T05:20:25.678236807-05:00" level=debug msg="Listener created for HTTP on fd ()"
Feb 07 18:20:25 DebianV dockerd[641]: time="2017-02-07T05:20:25.680978493-05:00" level=info msg="libcontainerd: new containerd process, pid: 689"
Feb 07 18:20:25 DebianV dockerd[641]: time="2017-02-07T05:20:25.73650121-05:00" level=debug msg="containerd: read past events" count=0
Feb 07 18:20:25 DebianV dockerd[641]: time="2017-02-07T05:20:25.736734581-05:00" level=debug msg="containerd: supervisor running" cpus=4 memory=7892 runtime=docker-runc runtimeArgs=[] stateDir="/var/run/docker/libcontainerd/containerd"
Feb 07 18:20:25 DebianV dockerd[641]: time="2017-02-07T05:20:25.736883058-05:00" level=debug msg="containerd: grpc api on /var/run/docker/libcontainerd/docker-containerd.sock"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.184662338-05:00" level=debug msg="libcontainerd: containerd health check returned error: rpc error: code = 14 desc = grpc: the connection is unavailable"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.682885811-05:00" level=debug msg="libcontainerd: containerd health check returned error: rpc error: code = 14 desc = grpc: the connection is unavailable"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.685111343-05:00" level=debug msg="Using default logging driver json-file"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.685162198-05:00" level=debug msg="Golang's threads limit set to 56160"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.692662747-05:00" level=debug msg="[graphdriver] trying provided driver: overlay2"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.706786753-05:00" level=debug msg="backingFs=extfs,  projectQuotaSupported=false"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.706818944-05:00" level=debug msg="Using graph driver overlay2"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.760129005-05:00" level=debug msg="Max Concurrent Downloads: 3"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.760168524-05:00" level=debug msg="Max Concurrent Uploads: 5"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.797342606-05:00" level=info msg="Graph migration to content-addressability took 0.00 seconds"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.797592133-05:00" level=warning msg="Your kernel does not support swap memory limit."
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.797655597-05:00" level=warning msg="Your kernel does not support cgroup rt period"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.797672209-05:00" level=warning msg="Your kernel does not support cgroup rt runtime"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.798426501-05:00" level=info msg="Loading containers: start."
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.801134155-05:00" level=debug msg="Loaded container 20b7feb5fd9f9317971ccf0beef82822293064a17ee0253d15f2d28d7701b010"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.802298081-05:00" level=debug msg="Loaded container a1f4d5471b0aaa56df52dda1253cb325477f8f83e7f41a5441b64384d4750471"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.812496877-05:00" level=debug msg="Option Experimental: false"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.812527852-05:00" level=debug msg="Option DefaultDriver: bridge"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.812539738-05:00" level=debug msg="Option DefaultNetwork: bridge"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.841694577-05:00" level=info msg="Firewalld running: false"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.856005602-05:00" level=debug msg="/sbin/iptables, [--wait --version]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.857414764-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -D PREROUTING -m addrtype --dst-type LOCAL -j DOCKER]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.869113924-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -D OUTPUT -m addrtype --dst-type LOCAL ! --dst 127.0.0.0/8 -j DOCKER]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.870838360-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -D OUTPUT -m addrtype --dst-type LOCAL -j DOCKER]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.872793309-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -D PREROUTING]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.874958085-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -D OUTPUT]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.876162603-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -F DOCKER]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.877293053-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -X DOCKER]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.878215362-05:00" level=debug msg="/sbin/iptables, [--wait -t filter -F DOCKER]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.879117490-05:00" level=debug msg="/sbin/iptables, [--wait -t filter -X DOCKER]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.880245980-05:00" level=debug msg="/sbin/iptables, [--wait -t filter -F DOCKER-ISOLATION]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.881168273-05:00" level=debug msg="/sbin/iptables, [--wait -t filter -X DOCKER-ISOLATION]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.882179754-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -n -L DOCKER]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.883202411-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -N DOCKER]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.884433600-05:00" level=debug msg="/sbin/iptables, [--wait -t filter -n -L DOCKER]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.885449539-05:00" level=debug msg="/sbin/iptables, [--wait -t filter -N DOCKER]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.886769951-05:00" level=debug msg="/sbin/iptables, [--wait -t filter -n -L DOCKER-ISOLATION]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.888174540-05:00" level=debug msg="/sbin/iptables, [--wait -t filter -N DOCKER-ISOLATION]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.889467417-05:00" level=debug msg="/sbin/iptables, [--wait -t filter -C DOCKER-ISOLATION -j RETURN]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.890676291-05:00" level=debug msg="/sbin/iptables, [--wait -I DOCKER-ISOLATION -j RETURN]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.892376504-05:00" level=debug msg="/sbin/iptables, [--wait -t filter -P FORWARD DROP]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.900192096-05:00" level=debug msg="Did not find any interface with name docker0: Link not found"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.900686508-05:00" level=debug msg="Setting bridge mac address to 02:42:09:8e:c7:3a"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.900747358-05:00" level=debug msg="Assigning address to bridge interface docker0: 172.17.0.1/16"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.900821155-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -C POSTROUTING -s 172.17.0.0/16 ! -o docker0 -j MASQUERADE]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.903652800-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -I POSTROUTING -s 172.17.0.0/16 ! -o docker0 -j MASQUERADE]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.908402753-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -C DOCKER -i docker0 -j RETURN]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.909608576-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -I DOCKER -i docker0 -j RETURN]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.910667632-05:00" level=debug msg="/sbin/iptables, [--wait -D FORWARD -i docker0 -o docker0 -j DROP]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.911902773-05:00" level=debug msg="/sbin/iptables, [--wait -t filter -C FORWARD -i docker0 -o docker0 -j ACCEPT]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.912940558-05:00" level=debug msg="/sbin/iptables, [--wait -I FORWARD -i docker0 -o docker0 -j ACCEPT]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.914235636-05:00" level=debug msg="/sbin/iptables, [--wait -t filter -C FORWARD -i docker0 ! -o docker0 -j ACCEPT]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.915534854-05:00" level=debug msg="/sbin/iptables, [--wait -I FORWARD -i docker0 ! -o docker0 -j ACCEPT]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.916885890-05:00" level=debug msg="/sbin/iptables, [--wait -t filter -C FORWARD -o docker0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.918711320-05:00" level=debug msg="/sbin/iptables, [--wait -I FORWARD -o docker0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.920141785-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -C PREROUTING -m addrtype --dst-type LOCAL -j DOCKER]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.921204395-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.922592836-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -C OUTPUT -m addrtype --dst-type LOCAL -j DOCKER ! --dst 127.0.0.0/8]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.924188236-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -A OUTPUT -m addrtype --dst-type LOCAL -j DOCKER ! --dst 127.0.0.0/8]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.925686674-05:00" level=debug msg="/sbin/iptables, [--wait -t filter -C FORWARD -o docker0 -j DOCKER]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.926696577-05:00" level=debug msg="/sbin/iptables, [--wait -I FORWARD -o docker0 -j DOCKER]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.927727203-05:00" level=debug msg="/sbin/iptables, [--wait -t filter -C FORWARD -j DOCKER-ISOLATION]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.928674510-05:00" level=debug msg="/sbin/iptables, [--wait -I FORWARD -j DOCKER-ISOLATION]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.929826720-05:00" level=debug msg="Network (1051b85) restored"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.948430206-05:00" level=debug msg="Allocating IPv4 pools for network bridge (1051b850f6816ed2aee01f557af3d6916f2351af3db10663f7994d3fc3309a20)"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.948744303-05:00" level=debug msg="RequestPool(LocalDefault, 172.17.0.0/16, , map[], false)"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.948808713-05:00" level=debug msg="RequestAddress(LocalDefault/172.17.0.0/16, 172.17.0.1, map[RequestAddressType:com.docker.network.gateway])"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.952487468-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -C POSTROUTING -s 172.17.0.0/16 ! -o docker0 -j MASQUERADE]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.955374734-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -D POSTROUTING -s 172.17.0.0/16 ! -o docker0 -j MASQUERADE]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.956724396-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -C DOCKER -i docker0 -j RETURN]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.958499869-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -D DOCKER -i docker0 -j RETURN]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.959668312-05:00" level=debug msg="/sbin/iptables, [--wait -t filter -C FORWARD -i docker0 -o docker0 -j ACCEPT]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.961694367-05:00" level=debug msg="/sbin/iptables, [--wait -D FORWARD -i docker0 -o docker0 -j ACCEPT]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.962988747-05:00" level=debug msg="/sbin/iptables, [--wait -t filter -C FORWARD -i docker0 ! -o docker0 -j ACCEPT]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.964140719-05:00" level=debug msg="/sbin/iptables, [--wait -D FORWARD -i docker0 ! -o docker0 -j ACCEPT]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.966230938-05:00" level=debug msg="/sbin/iptables, [--wait -t filter -C FORWARD -o docker0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.967920820-05:00" level=debug msg="/sbin/iptables, [--wait -D FORWARD -o docker0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.969579637-05:00" level=debug msg="/sbin/iptables, [--wait -t filter -C FORWARD -o docker0 -j DOCKER]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.982011576-05:00" level=debug msg="/sbin/iptables, [--wait -t filter -C FORWARD -o docker0 -j DOCKER]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.983855543-05:00" level=debug msg="/sbin/iptables, [--wait -D FORWARD -o docker0 -j DOCKER]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.988900941-05:00" level=debug msg="releasing IPv4 pools from network bridge (1051b850f6816ed2aee01f557af3d6916f2351af3db10663f7994d3fc3309a20)"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.988938606-05:00" level=debug msg="ReleaseAddress(LocalDefault/172.17.0.0/16, 172.17.0.1)"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.988964218-05:00" level=debug msg="ReleasePool(LocalDefault/172.17.0.0/16)"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.996004689-05: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"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.996077622-05:00" level=debug msg="Allocating IPv4 pools for network bridge (5d008ad86bc279feae6bb57a19443068fc5e9bc23894383dbd23d8e552ae4972)"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.996099738-05:00" level=debug msg="RequestPool(LocalDefault, 172.17.0.0/16, , map[], false)"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.996138331-05:00" level=debug msg="RequestAddress(LocalDefault/172.17.0.0/16, 172.17.0.1, map[RequestAddressType:com.docker.network.gateway])"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.996338899-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -C POSTROUTING -s 172.17.0.0/16 ! -o docker0 -j MASQUERADE]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.998045755-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -I POSTROUTING -s 172.17.0.0/16 ! -o docker0 -j MASQUERADE]"
Feb 07 18:20:26 DebianV dockerd[641]: time="2017-02-07T05:20:26.999890769-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -C DOCKER -i docker0 -j RETURN]"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.001411556-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -I DOCKER -i docker0 -j RETURN]"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.002796387-05:00" level=debug msg="/sbin/iptables, [--wait -D FORWARD -i docker0 -o docker0 -j DROP]"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.005507596-05:00" level=debug msg="/sbin/iptables, [--wait -t filter -C FORWARD -i docker0 -o docker0 -j ACCEPT]"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.007945397-05:00" level=debug msg="/sbin/iptables, [--wait -I FORWARD -i docker0 -o docker0 -j ACCEPT]"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.009553277-05:00" level=debug msg="/sbin/iptables, [--wait -t filter -C FORWARD -i docker0 ! -o docker0 -j ACCEPT]"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.011134636-05:00" level=debug msg="/sbin/iptables, [--wait -I FORWARD -i docker0 ! -o docker0 -j ACCEPT]"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.012863616-05:00" level=debug msg="/sbin/iptables, [--wait -t filter -C FORWARD -o docker0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT]"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.014507969-05:00" level=debug msg="/sbin/iptables, [--wait -I FORWARD -o docker0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT]"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.016206339-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -C PREROUTING -m addrtype --dst-type LOCAL -j DOCKER]"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.017849596-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -C PREROUTING -m addrtype --dst-type LOCAL -j DOCKER]"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.019419670-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -C OUTPUT -m addrtype --dst-type LOCAL -j DOCKER ! --dst 127.0.0.0/8]"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.021080108-05:00" level=debug msg="/sbin/iptables, [--wait -t nat -C OUTPUT -m addrtype --dst-type LOCAL -j DOCKER ! --dst 127.0.0.0/8]"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.022686053-05:00" level=debug msg="/sbin/iptables, [--wait -t filter -C FORWARD -o docker0 -j DOCKER]"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.024285206-05:00" level=debug msg="/sbin/iptables, [--wait -I FORWARD -o docker0 -j DOCKER]"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.031344452-05:00" level=debug msg="/sbin/iptables, [--wait -t filter -C FORWARD -j DOCKER-ISOLATION]"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.038642024-05:00" level=debug msg="/sbin/iptables, [--wait -D FORWARD -j DOCKER-ISOLATION]"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.040342056-05:00" level=debug msg="/sbin/iptables, [--wait -I FORWARD -j DOCKER-ISOLATION]"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.052652239-05:00" level=debug msg="Starting container a1f4d5471b0aaa56df52dda1253cb325477f8f83e7f41a5441b64384d4750471"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.061762755-05:00" level=debug msg="container mounted via layerStore: /var/lib/docker/overlay2/3d26a41419b24a29c56cb045fc3e36377f612ae4afe72e4bec71d5b621be1098/merged"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.062039104-05:00" level=debug msg="Assigning addresses for endpoint db-mysql's interface on network bridge"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.062068648-05:00" level=debug msg="RequestAddress(LocalDefault/172.17.0.0/16, <nil>, map[])"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.073698920-05:00" level=debug msg="Assigning addresses for endpoint db-mysql's interface on network bridge"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.133676914-05:00" level=debug msg="Releasing addresses for endpoint db-mysql's interface on network bridge"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.133709009-05:00" level=debug msg="ReleaseAddress(LocalDefault/172.17.0.0/16, 172.17.0.2)"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.140074937-05:00" level=warning msg="error locating sandbox id 3379ca22818f326ee78d83327c1a927ff9c10862b24d051eddda3455cddf63a7: sandbox 3379ca22818f326ee78d83327c1a927ff9c10862b24d051eddda3455cddf63a7 not found"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.140156532-05:00" level=warning msg="failed to cleanup ipc mounts:\nfailed to umount /var/lib/docker/containers/a1f4d5471b0aaa56df52dda1253cb325477f8f83e7f41a5441b64384d4750471/shm: invalid argument"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.159819035-05:00" level=error msg="Failed to start container a1f4d5471b0aaa56df52dda1253cb325477f8f83e7f41a5441b64384d4750471: open /etc/resolv.conf: no such file or directory"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.159867740-05:00" level=info msg="Loading containers: done."
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.206574056-05:00" level=info msg="Daemon has completed initialization"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.207257097-05:00" level=info msg="Docker daemon" commit=49bf474 graphdriver=overlay2 version=1.13.0
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.207778425-05:00" level=debug msg="Registering routers"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.208066178-05:00" level=debug msg="Registering GET, /containers/{name:.*}/checkpoints"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.208270977-05:00" level=debug msg="Registering POST, /containers/{name:.*}/checkpoints"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.208363039-05:00" level=debug msg="Registering DELETE, /containers/{name}/checkpoints/{checkpoint}"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.208496291-05:00" level=debug msg="Registering HEAD, /containers/{name:.*}/archive"
Feb 07 18:20:27 DebianV dockerd[641]: time="2017-02-07T05:20:27.208638014-05:00" level=debug msg="Registering GET, /containers/json"

添加docker ps-a message,$docker ps-a CONTAINER ID IMAGE命令CREATED STATUS PORTS NAMES a1f4d5471b0a mysql:8.0“docker-entrypoint...”15小时前退出(128)17分钟前db-mysql 20b7feb5fd9f hello-world“/hello”16小时前退出(0)16小时前youthful_golick

我使用'$docker logs db-mysql'来显示容器的上次日志时间,重启后没有变化。所以我认为这不是容器在重新启动后启动,然后稍后退出的情况

共有1个答案

谯阳伯
2023-03-14

我的问题解决了。它是由docker启动期间缺少/etc/resolv.conf引起的。

docker守护进程试图启动容器,但找不到/etc/resolv.conf文件,因此失败。

/etc/reslv.conf是指向/var/run/networkmanger/resolv.conf的链接文件。
在我的操作系统中,/etc/resolv.conf将由NetworkManager更新,因为它不是静态ip,所以,在我登录并连接到网络之前,该文件不存在!

我在/etc/networkmanager/networkmanager.conf中更改了NetworkManger的配置,在[main]区域中设置了'DNS=none',因此停止修改resolv.conf。在删除链接文件/etc/resolv.conf的同时,为/etc/resolv.conf添加一个新文件,比如'nameserver=8.8.8.8'

重启后,docker容器可以自动启动,工作正常!

 类似资料:
  • 我有以下系统脚本: 运行命令:systemctl start/stop hub工作正常。我还使用systemctl启用集线器创建了符号链接。为什么我的服务在我重新启动整个笔记本电脑后没有启动?我遵循了docker指南,以便Docker在重新启动时启动,但由于某种原因我的容器没有启动。我的脚本中缺少一个字段吗? 我正在使用ExecStart,“/home/hub/hub.sh”脚本的命令是: 重新启

  • 问题内容: 尝试停止或重新启动Docker容器时,我收到以下错误消息: 但是当我跑步时 我可以看到日志,因此显然容器确实存在。有任何想法吗? 编辑: 抱歉,我忘了提一下: 运行时,我看到容器已启动并正在运行。但是,其中的应用程序出现故障,因此我想重新启动它,或者只是在线获取该应用程序的新版本。但是,当我无法停止并删除容器时,也无法启动并运行要监听同一端口的新应用程序。 问题答案: 看起来像dock

  • 问题内容: 我的日食没有启动,因为我的计算机有点死机了,所以我不得不强制重新启动它。当我不得不重新启动时,Eclipse是打开的,我相信这很可能是原因。我不知道该如何解决。每当我尝试打开它时,它都会告诉我检查工作区中的.log文件,并显示: http://paste.strictfp.com/26579 而且我不知道如何解决它。请帮忙? 问题答案: 您缺少 第125行的 类,您必须重新安装才能解决

  • 问题内容: 今天,我使用appcontainers / mediawiki docker映像部署了MediaWiki实例,现在遇到一个新问题,无法找到任何线索。尝试使用以下方法附加到mediawiki前端容器后: 出于我忽略的原因,它在我的配置上做出回答,还尝试: 我确实收到错误消息附近的内容: 这是我的新问题,因为此容器永不停止重新启动。我看到使用总是返回STATUS的状态。 问题是,我能够停止

  • 我今天使用应用程序容器/媒体维基泊出程序映像部署了MediaWiki的一个实例,我现在遇到了一个新问题,我找不到任何线索。尝试使用以下命令附加到媒体维基前端容器后: 由于我忽略的原因,它在我的配置中回答< code >终止,并尝试: 我确实收到了一些接近错误消息的内容: 这是我的新问题,因为这个容器永远不会停止重新启动。我可以看到,使用<code>docker ps-a。 问题是,我能够停止容器(

  • docker守护进程在我的计算机(Linux/Centos 7)上不再启动了,我强烈怀疑在这种情况下是一个设置为自动重启的容器造成的。如果我手动启动守护进程,我看到的最后一行是“装载容器:启动”,然后它只是挂起。 我想做的是在不启动任何容器的情况下启动守护进程。但我找不到任何选择。在docker中是否有任何选项可以启动守护进程而不将启动容器设置为自动重启?如果没有,是否有一种方法可以手动移除容器,