How to start the container through image by docker
This article introduces how docker starts the container through the image. The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.
The image of Docker is called image and the container is called container. For Docker, image is static, similar to operating system snapshots, while container is dynamic, a running instance of image.
For example, if there is an image named ubuntu, now let's start the container of the image and enter the bash command line of the container:
Docker run-t-I ubuntu / bin/bash
Docker run: start containerubuntu: the image-t you want to start: enter the terminal-I: get an interactive connection by getting the input of container / bin/bash: start a bash shell in container
This brings you into the inside of container:
Root@af8bae53bdd3:/#
If you have a running container, you can run it on the same external operating system as container:
Docker ps
View this container. If you want to see all the container, including running, and not running or sleeping images, run:
Docker ps-a
If you want to quit: Ctrl-D or: root@af8bae53bdd3:/# exit
Start the container (container) of an image (mirror) in docker
To open the container again, run:
Docker start goofy_almeida
This is how to share docker through the image startup container. I hope the above content can be helpful to you and learn more. If you think the article is good, you can share it for more people to see.