operation used commands docker

1 ), the mirror operation

operating

command

Explanation

Retrieval

docker search keywords eg: docker search redis

We often detailed information on the hub to retrieve the mirror docker, such as mirroring of TAG.

Pull

docker pull mirror name: tag

: Tag is optional, tag represents the label, multi-version software, the default is the latest

List

 

docker images

View all local mirror

delete

 

docker rmi image-id

Delete the specified local mirror

 

https://hub.docker.com/

2 ), container operation

Mirroring software (QQ Setup) ---- ---- generates a run-time image of the container (running software, running QQ); Step:

 

1. Search Mirror

[root@localhost  ~]#  docker  search  tomcat

2, pulling the mirror

[root@localhost  ~]#  docker  pull  tomcat

3, the container according to the start image

docker  run  ‐‐name  mytomcat  ‐d  tomcat:latest

4、docker ps

Check the operation of the vessel

5, stops the operation of the vessel

id docker stop the container

6. Check all containers

docker ps ‐a

7, start the container

docker start container id

8, delete a container docker rm container id

9, the start of a port mapping tomcat

[root@localhost  ~]#  docker  run  ‐d  ‐p  8888:8080  tomcat

-d: background

-P : a host interface port mapped to the container       port of the host : the interior of the container port

10、为了演示简单关闭了linux的防火墙

service  firewalld  status  ;查看防火墙状态

service  firewalld  stop:关闭防火墙         

11、查看容器的日志

docker  logs  container‐name/container‐id

 

更多命令参看

https://docs.docker.com/engine/reference/commandline/docker/

 

可以参考每一个镜像的文档

 

 



‐p: 将主机的端口映射到容器的一个端口

Guess you like

Origin www.cnblogs.com/yanl55555/p/12091940.html