简体   繁体   English

无法启动容器

[英]Unable to start container

I'm new to docker and trying to implement docker using chef on centos 7.1 Below is the basic code I wrote for installing, pulling centos image and creating container. 我是Docker的新手,并尝试在centos 7.1上使用Chef实施docker。以下是我编写的用于安装,提取centos映像和创建容器的基本代码。

All the 3 tasks are executing successfully. 这三个任务全部成功执行。 Since the containers are in stop mode I tried to start manually by typing docker start containerid . 由于容器处于停止模式,因此我尝试通过键入docker start containerid手动docker start containerid When I checked docker ps I found the container is not started . 当我检查docker ps我发现该容器未启动。 I tried for several times but couldn't start the container. 我尝试了几次,但是无法启动容器。

Docker code using chef 使用Chef的Docker代码

docker_service 'default' do
  action [:create, :start]
end

docker_image 'centos' do
  action :pull
end

docker_container 'check2' do
  repo 'centos'
  action :create
end

Docker info: Docker信息:

Containers: 6
 Running: 1
 Paused: 0
 Stopped: 5
Images: 3
Server Version: 1.12.1
Storage Driver: devicemapper
 Pool Name: docker-8:1-523814-pool
 Pool Blocksize: 65.54 kB
 Base Device Size: 10.74 GB
 Backing Filesystem: xfs
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 441.3 MB
 Data Space Total: 107.4 GB
 Data Space Available: 28.08 GB
 Metadata Space Used: 1.159 MB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 2.146 GB
 Thin Pool Minimum Free Space: 10.74 GB
 Udev Sync Supported: true
 Deferred Removal Enabled: false
 Deferred Deletion Enabled: false
 Deferred Deleted Device Count: 0
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 WARNING: Usage of loopback devices is strongly discouraged for production use. Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.107-RHEL7 (2016-06-09)
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: null host bridge overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: seccomp
Kernel Version: 3.10.0-229.4.2.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 6.807 GiB
ID: R24R:ORHY:XJQW:2HNI:U5TV:UGF7:B7VX:P6Z6:UHSR:YIMR:VGJT:4URU
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
Insecure Registries:
 127.0.0.0/8

Would you please help me 你能帮我吗

By default, the centos image will run /bin/bash which will exit immediately without a tty ( -t ) and standard input ( -i ) available. 默认情况下, centos映像将运行/bin/bash ,它将立即退出,而没有tty( -t )和标准输入( -i )可用。

Try running something in the container 尝试在容器中运行某些内容

docker_container 'check2' do
  repo 'centos'
  command 'top -b -d 5'
end

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM