2017-02-07 102 views
1

我想容器在電腦重啓後自動啓動,所以我使用'--restart = always'標誌,但它不會運行,因爲我預期。當我重新啓動系統時,容器沒有啓動。碼頭重啓後無法啓動容器使用'--restart-always'

i'v試圖將存儲驅動程序從aufs更改爲overlay2,使用'-s overlay2',但我沒有幫助。

$ 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 

泊塢窗日誌信息

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" 

添加泊塢窗PS -a消息, $搬運工PS -a 容器ID IMAGE命令創建的狀態端口名字 a1f4d5471b0a mysql:8.0「docker-entrypoint ...」15小時前已退出(128)17分鐘前db-mysql 20b7feb5fd9f你好世界「/你好」 17小時以前結束(0)17小時以前youthful_golick

我的用戶「$搬運工日誌DB-mysql的」顯示上次登錄的時間容器,它不是重啓後改變。所以我認爲這不是重啓後啓動容器的情況,然後退出

+0

您的容器很有可能啓動但意外退出。如果是這樣的話,容器日誌會比守護進程更有趣。 – n00dl3

+1

重啓後'docker ps'和/或'docker ps -a'的輸出可能也很有趣。 – Martin

+0

感謝您的回答!我測試重啓後啓動的容器的狀態,稍後退出一些共振狀態。我認爲這不是這種情況。 – vence

回答

0

我的問題解決了。這是由docker啓動過程中/etc/resolv.conf丟失引起的。

docker守護進程嘗試啓動容器,但它找不到文件/etc/resolv.conf,因此失敗。

/etc/reslv.conf是/var/run/NetworkManger/resolv.conf的鏈接文件。
在我的os中,/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容器可以自動啓動,運行精細!