Run a Docker image as a container

后端 未结 11 2049
终归单人心
终归单人心 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条回答
  •  萌比男神i
    2020-12-04 05:19

    I had the same problem. I ran my Docker image, and it created a container with a specific CONTAINER_ID. I wanted to work with the same container:

    First run your Docker image:

    docker run -it -p 8888:8888 -p 6006:6006 -v ~/:/host waleedka/modern-deep-learning
    

    Then list all the containers you have made:

    sudo docker ps -a
    

    And select the container you want to work with (mine is 167ffffd6d7f15):

    sudo docker start -ai 167ffffd6d7f15
    

提交回复
热议问题