首先移掉之前所有的容器:
[root@xiaoxiao tomcat]# docker rm $(docker ps -aq)
fcfddcab1789
[root@xiaoxiao tomcat]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
[root@xiaoxiao tomcat]# docker rmi -f $(docker images -aq)
Untagged: diytomcat:latest
Deleted: sha256:263f80b3527fe1ca1fbfd928dcc99582da26acdd15205bb4df7a431704b89944
Deleted: sha256:e06130ae40e0f35d829096c1d8c9f15738f7c1c336c12c4c8b9717ed3e0582a5
Deleted: sha256:97e33bd327a5b7bcb84aef8b655addd58e7ff00f0fe6a6a292054fb366d871ab
Deleted: sha256:821d4127e6aa9117a44b6898ea70cbd927488acd3b75b63900127977b3b1aa5a
Deleted: sha256:7d8c9901005b0ff64bbc77f5e2b1f9c720f7287a05d728c52a16eed1493bb502
Deleted: sha256:20a0cbfc9e9d7eec2e51ab5da708c11c8f661dca5091626cb987eaf2ffe9f31d
Deleted: sha256:a2a0b7c272a7c69ab20dc6fb04cb901beaf92d3843d026274c1ab9dbb39ab5bd
#测试一下,在linux中获取ip地址的方法
[root@xiaoxiao tomcat]# ip addr
#本机回环地址
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
#阿里云内网地址
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP <