简体   繁体   中英

docker cannot start container

When I run a container with -p, it failed like this:

[root@localhost ~]# docker run -it -p 40000:40000 docker.io/centos:7 /bin/bash
FATA[0001] Error response from daemon: Cannot start container f3acda2a65a1521630694a9e019cc8a7131dc58dd10bdfcaa85d1e28f434d8f4:  (exit status 1) 

and this is my env:

[root@localhost ~]# uname -r
3.10.0-229.el7.x86_64
[root@localhost ~]# docker version
Client version: 1.6.0
Client API version: 1.18
Go version (client): go1.4.2
Git commit (client): 8aae715/1.6.0
OS/Arch (client): linux/amd64
Server version: 1.6.0
Server API version: 1.18
Go version (server): go1.4.2
Git commit (server): 8aae715/1.6.0
OS/Arch (server): linux/amd64

but if I restart docker service, the run command works.

[root@localhost ~]# service docker restart
Redirecting to /bin/systemctl restart  docker.service
[root@localhost ~]# docker run -it -p 40000:40000 docker.io/centos:7 /bin/bash
[root@2ccbc3362e12 /]# ls
bin  dev  etc  home  lib  lib64  lost+found  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var

can anyone tell me what causes this problem?

Maybe the port you want to use is already taken by an other container. So when you restart the docker service it close this container.

You can look at running container using docker ps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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