Test learning-105-docker container installation, service deployment service uninstallation

Foreword:

  In testing work, docker is a tool that is often encountered. Many manufacturers use docker to deploy and install software environments. The later software upgrade configuration is very simple. Especially during the deployment process.

  Docker is an open source application container engine that allows developers to package their applications and dependencies into a portable image , and then publish it to any popular  Linux or Windows  machine, which can also be virtualized . Containers use the sandbox mechanism completely , and there will be no interfaces between them.

  Today, let's talk about how to use docker installation, use, service deployment, and service uninstallation.

1. Docker installation

     Docker's yum installation, and offline installation. There are many tutorials on the Internet, so I won’t repeat them here.

    https://www.cnblogs.com/liuxiaoji/p/11014329.html

     https://www.cnblogs.com/ljhblogs/p/11754136.html

2. Docker runs the installation software to the docker container

执行启动        systemctl restart  docker.service
加入开机启动    systemctl enable  docker.service   开机docker自启动
测试执行        docker images   查看镜像
查看所有镜像     docker ps -a

 

 

 2.1. Under normal circumstances, docker installs all encapsulated tar packages.

 The following two commands will work. Import the face-happy-interface image into the image library

docker load -i face-happy-interface.tar
或者
docker load < face-happy-interface.tar

2.2 Check whether the face-happy-interface image has been imported into the image library

docker images face-happy-interface

If face-happy-interface has been executed in the mirror library

docker run -d -it --name=face-interface -p 813194:3194 -v /home/1400_war/face-interface/config:/home/1400_war/face-interface/config -v /etc/hosts:/etc/hosts -v /home/1400_war/face-interface/logs:/face-interface-log --restart=always viid/face-interface:v1

docker run is a very long command. There is a command in it to realize self-starting after booting. If it is shut down, the service will start automatically after docker is started.

--restart=always

2.3 View a certain service

docker ps|grep face-happy-interface
docker ps 查看所有运行的服务

docker ps -a  查看所有服务

3. Uninstallation of services in Docker

3.1 View service

docker ps

3.2 Stop service

docker stop face-happy-interface

3.3 Delete service

docker images   查看镜像
docker rm face-happy-interface

3.4 Remove the image package

docker rmi viid/face-interface:v1

The above is the complete delete series, the following is the complete delete command sequence.

docker ps
docker stop face-interface
docker images
docker rm face-interface
docker rmi viid/face-interface:v1

If you have any questions, please leave a message to see that you must reply
 

Guess you like

Origin blog.csdn.net/u013521274/article/details/109539306