docker instruction collection collates the of collection

  • 2020-06-07 05:37:26
  • OfStack

Docker is a high-level container engine based on Linux container (ES3en-ES4en container). It is developed based on go language. The source code is hosted on Github. Docker aims to achieve a lightweight operating system virtualization solution.

1. Docker installation

utuntu Installed in the docker : 
 apt-get install docker-engine
 apt-get install docker 
 apt-get install

Other systems use similar package managers, centos USES yum

2. Download, view, launch and delete images

docker pull ubuntu:latest //  Download the latest Ubuntu The mirror 
 View the downloaded image: docker images
 Start the docker Mirror: docker run -dit imagesid /bin/bash  // -d:daemon -t: terminal -i: Enter the inputable state 
 Delete image: docker rmi imageid

3. Container operation

 open docker : docker start containerid
 Enter the docker: docker exec -it containerid command
 exit docker: exit
 stop docker :  docker stop containerid
 View containers in progress: docker ps 
 View all containers: docker ps -a
 Containers are stored as mirror images: 
docker commit container_id new_images_name
 Delete container: docker rm containername
 Remove all containers: docker rm $(docker ps -a -q)
 Delete image: docker rmi imageid

Related articles: