Run a Docker image as a container

后端 未结 11 2043
终归单人心
终归单人心 2020-12-04 04:27

After building a Docker image from a dockerfile, I see the image was built successfully, but what do I do with it? Shouldn\'t i be able to run it as a container

11条回答
  •  情深已故
    2020-12-04 05:03

    For those who had the same problem as well, but encountered an error like

    rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:247: starting container process caused "exec: \"bash\": executable file not found in $PATH"
    

    I added an entry point that was worked for me:

    docker run -it --entrypoint /bin/sh for the images without Bash.

    Example (from the approved example):

    run -it --entrypoint /bin/sh ubuntu:12.04
    

    Reference: https://gist.github.com/mitchwongho/11266726

提交回复
热议问题