Docker Community Forums

Share and learn in the Docker community.

Cannot start container


(Bill Wang) #1

I run the container for several days (in docker 1.9.1), but today when I start it, got below error:

[ec2-user@ip-172-31-0-116 ~]$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                    PORTS               NAMES
6cf52a3b570b        bwits/seagull       "seagull"           2 days ago          Exited (2) 11 hours ago                       grave_wright

[ec2-user@ip-172-31-0-116 ~]$ docker start 6c
Error response from daemon: Cannot start container 6c: Error getting container 6cf52a3b570b622c6aa0fa04e9e009546b9efc2dcf9d3b644bc16f20633e7860 from driver devicemapper: Error mounting '/dev/mapper/docker-202:2-42348138-6cf52a3b570b622c6aa0fa04e9e009546b9efc2dcf9d3b644bc16f20633e7860' on '/var/lib/docker/devicemapper/mnt/6cf52a3b570b622c6aa0fa04e9e009546b9efc2dcf9d3b644bc16f20633e7860': input/output error
Error: failed to start containers: [6c]
[ec2-user@ip-172-31-0-116 ~]$

(John Gasper) #2

The first thing I’d do is run:
docker logs 6cf52a3b570b

If the image is setup properly I’d hope you’ll get some info on why it won’t start.


(Thorsten Michels) #3

Hi Bill!
The last time when I ran in an error like this, it was a matter of too few disk space.
Did you check for enough free space already?

I hope this helps!

Cheers
Thorsten


(Bill Wang) #4

Thanks, @tmichels. That’s a new ec2 box (8GB), I run with docker for several days, and didn’t know if it was out of space at that time.

I had to clean the folder /var/lib/docker and reinstall docker, pull images again and start containers without issues until now.


(Thorsten Michels) #5

Hi all,

it mostly comes quicker, than one may expect, your HDD is completly filled with docker artifacts, noone needs any longer.

Well, you surely use the --rm flag, but there so many things that are not effected by this.
Your disks will slowly, but surely fill up with all the cached layers and unused images and stuff. You may run a cron job, but this is not the “Docker-Way” of life :wink:

One should use a docker container:

docker run \
  --restart \
  -e KEEP_IMAGES="ubuntu:14.04 corp/important-image:tag" \
  -v /var/run/docker.sock:/var/run/docker.sock:rw \
  -v /var/lib/docker:/var/lib/docker:rw \
  meltwater/docker-cleanup:latest

Look here for more details.

To give credit to whom credit is due, I found this link and adopted it to my needs.
So it will be a piece of cake to adopt it to your needs.


(Medebottam) #6

I get this error in Docker 1.8.3 on zLinux (s390x), when I try to run a container:
Error response from daemon: Cannot start container 2ace15251b5f5b650aab5edb61a491d3d3f038eef32c663ea82947ebbd468a0a: [8] System error: exec: “/bin/bash”: stat /bin/bash: no such file or directory

~]$ docker version
Client:
Version: 1.8.3
API version: 1.20
Go version: go1.4.2 gccgo (GCC) 5.2.0
Git commit: f4bf5c7-dirty
Built: Tue Oct 27 12:47:17 UTC 2015
OS/Arch: linux/s390x

Server:
Version: 1.8.3
API version: 1.20
Go version: go1.4.2 gccgo (GCC) 5.2.0
Git commit: f4bf5c7-dirty
Built: Tue Oct 27 12:47:17 UTC 2015
OS/Arch: linux/s390x

~]# uname -a
Linux yyyZLN900.xxx.zzz 3.10.0-229.el7.s390x #1 SMP Thu Jan 29 18:42:38 EST 2015 s390x s390x s390x GNU/Linux

~]$ docker logs 2ace15251b5f
exec: “/bin/bash”: stat /bin/bash: no such file or directory
exec: “/bin/bash”: stat /bin/bash: no such file or directory

~]$ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
z_rhel6.6_abc_image latest 91fa2176bab8 22 hours ago 288 MB

~]$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2ace15251b5f z_rhel6.6_abc_image:latest “/bin/bash” 22 hours ago Created z_rhel6.6_abc_con