10

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.

6
  • Please update the question to show the exact command line you used to export the image to a tar file, and the exact command line you used to import it on the other host. Commented Oct 21, 2016 at 2:50
  • I assume you are issuing a docker save to save the image to a tar file, then compress using gzip and using docker load you load the image contained in the tar.gz. I recommend you trying with uncompressed format, just tar. Commented Oct 21, 2016 at 3:44
  • 1
    Possibly your image does not have bash installed. Try docker run -it image_name /bin/sh Commented Oct 21, 2016 at 11:17
  • docker run -it image_name /bin/sh also does not work! Commented Oct 21, 2016 at 11:57
  • I am also facing same issue. wonder why there are down votes for this question!?!!! Commented Oct 21, 2016 at 22:41

3 Answers 3

2

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

Sign up to request clarification or add additional context in comments.

Comments

1

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.

Comments

0

I had the same issue, and it got resolved, after following the steps described in this post... https://www.jamescoyle.net/how-to/1512-export-and-import-a-docker-image-between-nodes

Instead of saving the docker image (I) as .tar and importing, we need to commit the exited container, based on the image (I), as new image (N). Then save the newly committed image (N) as .tar file, for importing into a new environment.

Hope this helps...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.