Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker container not running

Tags:

docker

I have created a docker image which is a python script based on a centos image. This image is working in the host system. Then I converted that image in tar.gz format. After that when I imported that tar.gz file into docker host(in a ubuntu system), it is done properly and the docker images list shows me the image listed in there. Then I tried to run the container in interactive mode using the following command:

$docker run -it image_name /bin/bash

it throws the following error:

docker: Error response from daemon: invalid header field value "oci runtime error: container_linux.go:247: starting container process caused \"exec: \\\"/bin/bash\\\": stat /bin/bash: no such file or directory\"\n".

Although docker run -it image_name /bin/bash command is working for all other images in my system. I tried almost all the means, but got no output apart from this error.

like image 902
Jit Avatar asked Oct 21 '16 02:10

Jit


2 Answers

I've just run into the same issue after updating Docker For Windows. It seems that it corrupted some image layers.

I cleared all the cached containers and images by running:

docker ps -qa|xargs docker rm -f
docker images -q|xargs docker rmi

The last command returned a few errors (some returned images didn't exist anymore).

Then I restarted the service and everything was running again.

like image 170
arvymetal Avatar answered Nov 09 '22 04:11

arvymetal


docker run -it image_name /bin/sh works for me! (Docker image, like Alpine, does not have /bin/bash).

like image 41
az642008 Avatar answered Nov 09 '22 03:11

az642008