Docker usage and application scenarios

Docker usage and application scenarios

Apple Mac OSX system Docker installation and use

installation

Terminal installation:

$ brew cask install docker

Manually download and install:

Download address: download.docker.com/mac/stable/...

Basic operation

Basic operation of mirroring:

$ docker pull python:3.6    #  python:3.6 
$ docker images    #  
$ docker images -a    #  
$ docker images -a -q    #  ID
$ docker rmi ID/NAME    #  
$ docker rmi $(sudo docker images -a -q)    #  
$ docker save -o sam-cctv.tar samv1/cctv:amqp    #  samv1/cctv:amqp sam-cctv.tar
$ docker load -i sam-cctv.tar    #  
$ docker tag samv1/cctv:amqp samv1/cctv:bak    #  samv1/cctv:amqp samv1/cctv:bak
 

Basic operation of the container:

$ docker ps   #  
$ docker ps -a    #  
$ docker ps -a -q    #  ID
$ docker ps rm ID/NAME    #  
$ docker rm $(sudo docker ps -a -q)    #  
 

Basic volume operation:

$ docker volume    #  
$ docker volume ls    #  
$ docker volume ls -q    #  ID
$ docker volume rm $(sudo docker volume ls -q)    #  
 

Start the service in swarm:

$ docker stack deploy -c docker-stack.yml samv1    #  docker-stack.yml samv1
$ docekr stack rm samv1    #  samv1 
 

Docker application scenarios

  • Automated packaging and publishing of web applications.
  • Automated testing and continuous integration and release.
  • Deploy and adjust databases or other background applications in a service-oriented environment.
  • Compile or extend the existing OpenShift or Cloud Foundry platform from scratch to build your own PaaS environment