[root@root ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ba1fc109da01 tomcat:9.0 "catalina.sh run" 3 hours ago Up 2 hours 0.0.0.0:8081->8080/tcp tomcat01
# 查看已下载的镜像
[root@root ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
centos latest 831691599b88 6 days ago 215MB
tomcat 9.0 2eb5a120304e 12 days ago 647MB
nginx latest 2622e6cca7eb 13 days ago 132MB
mysql 5.7 9cfcce23593a 13 days ago 448MB
# 新建运行一个mysql容器
[root@root ~]# docker run -d --name mysql01 -p 3306:3306 -e MYSQL_ROOT_PASSWORD=top@123 mysql:5.7
ead53ce248ee91fcf1febe82469fa4fa0c584f470437f7a389d132132d943030
[root@root ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ead53ce248ee mysql:5.7 "docker-entrypoint.s…" 11 seconds ago Up 10 seconds 0.0.0.0:3306->3306/tcp, 33060/tcp mysql01
ba1fc109da01 tomcat:9.0 "catalina.sh run" 3 hours ago Up 2 hours 0.0.0.0:8081->8080/tcp tomcat01
Docker+Mysql