Difference between Running and Starting a Docker container

后端 未结 6 1342
你的背包
你的背包 2020-12-12 08:39

In practice to start a container I do:

docker run a8asd8f9asdf0

If thats the case, what does:

docker start         


        
6条回答
  •  攒了一身酷
    2020-12-12 09:09

    • run runs an image
    • start starts a container.

    The docker run doc does mention:

    The docker run command first creates a writeable container layer over the specified image, and then starts it using the specified command.

    That is, docker run is equivalent to the API /containers/create then /containers/(id)/start.

    You do not run an existing container, you docker exec to it (since docker 1.3).
    You can restart an exited container.

提交回复
热议问题