[environment] docker: error response from daemon: OCI runtime

Background

When the compiled image is exported and loaded into another computer, the error is as follows:

//import mirror
docker import example.tar

//run the docker
docker run -it example:v20210119 /bin/bash

//error:
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: 
starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown.

For the description of this problem, there are probably two kinds of factional explanations on the Internet under Google

Left wing school

There is no/bin/bash in production, try/bin/sh, the result is still the problem

Right wing

Compatibility between Linux and docker. Then uninstall the old version and install the latest one.

The solution of the left faction is very easy to verify. After repeated verification, the problem is still unsolved. It is commonly known as the left faction.

The solution of the right faction is a bit difficult to verify, but intuition tells me that it should not be such a problem

Sure enough, I saw the right answer. After a careful look, a short description and a quick verification, the problem was solved.

this error occurs when docker runs. It is caused by different ways of saving the image. If the image is imported by using import, it should be noted that import can import the image package saved by save and the container package saved by export. However, if the image package saved by save is imported, there is no error. But this error occurs when run runs

    1. solutions
docker load < buildroot_v20210119.tar


Read More: