docker--Operation Container __docker

Source: Internet
Author: User
Tags docker run
StartThere are two ways to start a container, one is to create a new container based on mirroring and start Docker run, and the other is to restart the Docker container start new container with a container that is in the end state (stopped) and start: Docker run-i-t Mirror name bash Docker run-i-T--rm ubuntu:16.04 Bash-i Interactive operation, keep container standard input open-t use terminals, let Docker assign a pseudo terminal and bind to the container's standard input--RM the container after it exits ubuntu:16. 04 using the ubuntu:16.04 Mirror base to start the container bash mirror name after the command, here is the interactive shell Docker run creation container, Docker background running standard is: Check whether there is a local image, does not exist from the warehouse pull to the local; Using mirroring and starting a container; Assigning a file system, and to mount a layer of readable writable outside the read-only mirror layer, bridge a virtual interface into the container from the Network Bridge interface configured by the host, configure an IP address from the address pool to the container, execute the user-specified application, and execute the container termination; To start a container that has already been terminated: Use the Docker container Start command to start and run a container that has already been terminated Docker container start WEB5 Daemon State RunThe-d parameter enables the container to run in the background, the container running in the background will not output the results to the host interface, the output can be Docker logs container name/id view Docker run--name web7-d-P 11:80 nginx:v5 do not use the-d parameter, the container will The output results are printed to the host interface; Terminate ContainerDocker container Stop container name/ID use Docker container start Web8 #把容器重新启动 Enter the containerDocker exec back with parameters, enter container docker exec-it web4 bash exit container: Exit Delete ContainerTo delete a stop container: Docker container RM container name/container ID Delete a running container:-F parameter Docker container rm-f container name/container ID deletion all in the signaled stateThe container: Docker container Prune

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.