Document-Docker-WindowsX64-PC

Windows7 docker

VirtualBox-6.1.16-140961-Win.exe

DockerToolbox-19.03.1.exe

login as: docker
[email protected]'s password:
   ( '>')
  /) TC (\   Core is distributed with ABSOLUTELY NO WARRANTY.
 (/-_--_-\)           www.tinycorelinux.net


docker@default:~$
docker@default:~$ ifconfig
docker0   Link encap:Ethernet  HWaddr 02:42:BE:B0:BE:8B
          inet addr:172.17.0.1  Bcast:172.17.255.255  Mask:255.255.0.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth0      Link encap:Ethernet  HWaddr 08:00:27:88:69:7E
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe88:697e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:100 errors:0 dropped:0 overruns:0 frame:0
          TX packets:101 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:12761 (12.4 KiB)  TX bytes:12830 (12.5 KiB)

eth1      Link encap:Ethernet  HWaddr 08:00:27:37:FB:DB
          inet addr:192.168.99.100  Bcast:192.168.99.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe37:fbdb/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:42 errors:0 dropped:0 overruns:0 frame:0
          TX packets:50 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:6368 (6.2 KiB)  TX bytes:9378 (9.1 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

docker@default:~$ docker images|grep tomcat
tomcat              latest              bf4709e77b18        13 days ago         667MB
docker@default:~$ pwd
/home/docker
docker@default:~$ ls
docker@default:~$ cd ..
docker@default:/home$ cd ..
docker@default:/$ ls
bin           home          linuxrc       root          sys
c             init          mnt           run           tmp
dev           lib           opt           sbin          usr
etc           lib64         proc          squashfs.tgz  var
docker@default:/$ cd /usr
docker@default:/usr$ ls
bin    lib    local  sbin   share
docker@default:/usr$ cd /usr/local
docker@default:/usr/local$ ls
bin            lib            share
etc            sbin           tce.installed
docker@default:/usr/local$ mkdir -p ~/tomcat/webapps ~/tomcat/logs ~/tomcat/conf
docker@default:/usr/local$ ls
bin            lib            share
etc            sbin           tce.installed
docker@default:/usr/local$ cd /home/docker/tomcat
docker@default:~/tomcat$ ls
conf     logs     webapps
docker@default:~/tomcat$
docker@default:~/tomcat$ docker run --name tomcat -p 8080:8080 -v $PWD/test:/usr/local/tomcat/webapps/test -d tomcat
docker: Error response from daemon: Conflict. The container name "/tomcat" is already in use by container "8e8b9fa3fe695a7ea7d47cd9479482fce8ed207c526a2e155f7a4608e22b833". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.
docker@default:~/tomcat$ cd /usr/local/tomcat
-bash: cd: /usr/local/tomcat: No such file or directory
docker@default:~/tomcat$ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
docker@default:~/tomcat$ docker images|grep tomcat
tomcat              latest              bf4709e77b18        13 days ago         667MB
docker@default:~/tomcat$
docker@default:~/tomcat$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
tomcat              latest              bf4709e77b18        13 days ago         667MB
docker@default:~/tomcat$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                        PORTS                    NAMES
8e8b9fa3fe69        tomcat              "catalina.sh run"   About an hour ago   Exited (255) 18 minutes ago   0.0.0.0:8080->8080/tcp   tomcat
docker@default:~/tomcat$ docker rm 8e8b9fa3fe69
8e8b9fa3fe69
docker@default:~/tomcat$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
docker@default:~/tomcat$ docker rmi bf4709e77b18
Untagged: tomcat:latest
Untagged: tomcat@sha256:076f0048b1340813301852336c32628e7b351202f8ece983717bbb91046e2a62
Deleted: sha256:bf4709e77b18c34d3f1474c61433114c9e2f8c92963462a6689683f3ddefbc20
Deleted: sha256:cf99e4f97c49cba9d38a4b605fb1d9c78c69df64e2dd6c92c3cc510dc323f392
Deleted: sha256:fc8f0f8dec316dd6cd9b90b7d8d83a2202111e9b00dbee253fc4557e01fbed50
Deleted: sha256:769b134e65d4ab9166d9c0f001fac5c2b89fc92d81f68769bad67d09f4dc019d
Deleted: sha256:ed01232889798b88da17d8addd27587b50e2dc00338604ddb6f0c42c81384f66
Deleted: sha256:94172d5e19c476da2c2ec59b5bcd3c74b3dbbf4ba71d0322124bd7d175eb8547
Deleted: sha256:72623bb68a7b54c8d5a35a4a9720a7d43fbcbd64ae3f2fb2383a65d629f96b84
Deleted: sha256:e659b0af17afc5394fc283994bf1de70bed6f0e4c6b293df3a208892aea8f8f8
Deleted: sha256:222ce182141cd6c40655dd68f34fe4b8c9fcca30fe5767fea1ba30d84d5a2f07
Deleted: sha256:1ca91dc41a40b644015fa1fa4bd0a87c793296a1f7e9ab34548974889525dbcb
Deleted: sha256:7f03bfe4d6dc12155877f0d2e8b3429090bad1af7b005f75b7b3a874f386fd5a
docker@default:~/tomcat$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
docker@default:~/tomcat$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
docker@default:~/tomcat$ docker run --name tomcat -p 8080:8080 -v $PWD/test:/usr/local/tomcat/webapps/test -d tomcat
Unable to find image 'tomcat:latest' locally
latest: Pulling from library/tomcat
0ecb575e629c: Pull complete
7467d1831b69: Pull complete
feab2c490a3c: Pull complete
f15a0f46f8c3: Pull complete
26cb1dfcbebb: Pull complete
242c5446d23f: Pull complete
f22708c7c9c1: Pull complete
d8b7e17ca4bc: Pull complete
91588c31829d: Pull complete
d97abf351b5d: Pull complete
Digest: sha256:076f0048b1340813301852336c32628e7b351202f8ece983717bbb91046e2a62
Status: Downloaded newer image for tomcat:latest
a5e09d9cf366b87928512c40c71464a272505f9bd7b471c3ad6b724a9d1949fc
docker@default:~/tomcat$ docker images|grep tomcat
tomcat              latest              bf4709e77b18        13 days ago         667MB
docker@default:~/tomcat$ docker run --name tomcat -p 8080:8080 -v $PWD/test:/usr/local/tomcat/webapps/test -d tomcat
docker: Error response from daemon: Conflict. The container name "/tomcat" is already in use by container "a5e09d9cf366b87928512c40c71464a272505f9bd7b471c3adb724a9d1949fc". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.
docker@default:~/tomcat$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                    NAMES
a5e09d9cf366        tomcat              "catalina.sh run"   3 minutes ago       Up 2 minutes        0.0.0.0:8080->8080/tcp   tomcat
docker@default:~/tomcat$ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                    NAMES
a5e09d9cf366        tomcat              "catalina.sh run"   3 minutes ago       Up 3 minutes        0.0.0.0:8080->8080/tcp   tomcat
docker@default:~/tomcat$ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                    NAMES
a5e09d9cf366        tomcat              "catalina.sh run"   5 minutes ago       Up 5 minutes        0.0.0.0:8080->8080/tcp   tomcat
docker@default:~/tomcat$ pwd
/home/docker/tomcat
docker@default:~/tomcat$ ls
conf     logs     test     webapps
docker@default:~/tomcat$ cd /home/docker/tomcat/webapps
docker@default:~/tomcat/webapps$ ls
docker@default:~/tomcat/webapps$ cd /home/docker/tomcat/config
-bash: cd: /home/docker/tomcat/config: No such file or directory
docker@default:~/tomcat/webapps$ cd /home/docker/tomcat/conf
docker@default:~/tomcat/conf$ ls
docker@default:~/tomcat/conf$ cd /home/docker/tomcat/test
docker@default:~/tomcat/test$ ls
docker@default:~/tomcat/test$ cd /home/docker/tomcat/logs
docker@default:~/tomcat/logs$ ls
docker@default:~/tomcat/logs$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
tomcat              latest              bf4709e77b18        13 days ago         667MB
docker@default:~/tomcat/logs$ ifconfig
docker0   Link encap:Ethernet  HWaddr 02:42:BE:B0:BE:8B
          inet addr:172.17.0.1  Bcast:172.17.255.255  Mask:255.255.0.0
          inet6 addr: fe80::42:beff:feb0:be8b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:12 errors:0 dropped:0 overruns:0 frame:0
          TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3832 (3.7 KiB)  TX bytes:1937 (1.8 KiB)

eth0      Link encap:Ethernet  HWaddr 08:00:27:88:69:7E
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe88:697e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:261645 errors:0 dropped:0 overruns:0 frame:0
          TX packets:26774 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:355587764 (339.1 MiB)  TX bytes:1680171 (1.6 MiB)

eth1      Link encap:Ethernet  HWaddr 08:00:27:37:FB:DB
          inet addr:192.168.99.100  Bcast:192.168.99.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe37:fbdb/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2164 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2360 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:170322 (166.3 KiB)  TX bytes:424734 (414.7 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

vethcc9663a Link encap:Ethernet  HWaddr DE:A7:B7:FB:6D:95
          inet6 addr: fe80::dca7:b7ff:fefb:6d95/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:12 errors:0 dropped:0 overruns:0 frame:0
          TX packets:31 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:4000 (3.9 KiB)  TX bytes:2943 (2.8 KiB)

docker@default:~/tomcat/logs$ cd /home/docker/tomcat/webapps
docker@default:~/tomcat/webapps$

 

 

 

 

 

 

Document-Docker-WindowsX64-PC_第1张图片

 

 

Document-Docker-WindowsX64-PC_第2张图片

 

login as: docker
[email protected]'s password:
   ( '>')
  /) TC (\   Core is distributed with ABSOLUTELY NO WARRANTY.
 (/-_--_-\)           www.tinycorelinux.net


docker@default:~$
docker@default:~$ docker search tomcat
NAME                          DESCRIPTION                                     ST                                                                             ARS               OFFICIAL            AUTOMATED
tomcat                        Apache Tomcat is an open source implementati…   29                                                                             49                [OK]
tomee                         Apache TomEE is an all-Apache Java EE certif…   86                                                                                               [OK]
dordoka/tomcat                Ubuntu 14.04, Oracle JDK 8 and Tomcat 8 base…   55                                                                                                                   [OK]
bitnami/tomcat                Bitnami Tomcat Docker Image                     37                                                                                                                   [OK]
kubeguide/tomcat-app          Tomcat image for Chapter 1                      29                                                                             
consol/tomcat-7.0             Tomcat 7.0.57, 8080, "admin/admin"              18                                                                                                                   [OK]
cloudesire/tomcat             Tomcat server, 6/7/8                            15                                                                                                                   [OK]
aallam/tomcat-mysql           Debian, Oracle JDK, Tomcat & MySQL              13                                                                                                                   [OK]
arm32v7/tomcat                Apache Tomcat is an open source implementati…   10                                                                             
rightctrl/tomcat              CentOS , Oracle Java, tomcat application ssl…   6                                                                                                                    [OK]
unidata/tomcat-docker         Security-hardened Tomcat Docker container.      5                                                                                                                    [OK]
arm64v8/tomcat                Apache Tomcat is an open source implementati…   3                                                                              
amd64/tomcat                  Apache Tomcat is an open source implementati…   2                                                                              
cfje/tomcat-resource          Tomcat Concourse Resource                       2                                                                              
jelastic/tomcat               An image of the Tomcat Java application serv…   2                                                                              
fabric8/tomcat-8              Fabric8 Tomcat 8 Image                          2                                                                                                                    [OK]
picoded/tomcat7               tomcat7 with jre8 and MANAGER_USER / MANAGER…   1                                                                                                                    [OK]
chenyufeng/tomcat-centos      tomcat基于centos6的镜像                                                                                                           1                                       [OK]
camptocamp/tomcat-logback     Docker image for tomcat with logback integra…   1                                                                                                                    [OK]
99taxis/tomcat7               Tomcat7                                         1                                                                                                                    [OK]
oobsri/tomcat8                Testing CI Jobs with different names.           1                                                                              
ppc64le/tomcat                Apache Tomcat is an open source implementati…   1                                                                              
secoresearch/tomcat-varnish   Tomcat and Varnish 5.0                          0                                                                                                                    [OK]
softwareplant/tomcat          Tomcat images for jira-cloud testing            0                                                                                                                    [OK]
s390x/tomcat                  Apache Tomcat is an open source implementati…   0                                                                              
docker@default:~$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED                                                                                          SIZE
tomcat              latest              bf4709e77b18        13 days ago                                                                                      667MB
docker@default:~$ docket pull tomcat:7.0.56
-bash: docket: command not found
docker@default:~$ docker pull tomcat:7.0.56
7.0.56: Pulling from library/tomcat
Image docker.io/library/tomcat:7.0.56 uses outdated schema1 manifest format. Ple                                                                             ase upgrade to a schema2 image for better future compatibility. More information                                                                              at https://docs.docker.com/registry/spec/deprecated-schema-v1/
a3ed95caeb02: Pull complete
5d3df020ecd3: Pull complete
79d7401c2a5c: Pull complete
fc0422b60d1f: Pull complete
8caa0ae831ef: Pull complete
975ea51fd05c: Pull complete
6fdadc8c7552: Pull complete
Digest: sha256:5f2d634a9ac433da0d11a8260a50495aa2bb8f8edd29289b995a481a7d3e73a4
Status: Downloaded newer image for tomcat:7.0.56
docker.io/library/tomcat:7.0.56
docker@default:~$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                    NAMES
a5e09d9cf366        tomcat              "catalina.sh run"   15 hours ago        Up 15 hours         0.0.0.0:8080->8080/tcp   tomcat
docker@default:~$ cd /home/docker/tomcat
docker@default:~/tomcat$ ll
-bash: ll: command not found
docker@default:~/tomcat$ ls
conf     logs     test     webapps
docker@default:~/tomcat$ cd /home/docker/tomcat/webapps
docker@default:~/tomcat/webapps$ ls
1.txt
docker@default:~/tomcat/webapps$ docker run --name tomcat7.0.56 -p 8080:8080 -v /home/docker/tomcat/webapps:/home/docker/tomcat/webapps -d tomcat
d468440ecd263ae7be2f39b79d8d8134da352fad27cb58bd2ead0501c4ec7361
docker: Error response from daemon: driver failed programming external connectivity on endpoint tomcat7.0.56 (ba5826a86da67a646ee4d3fc86d7610a075275e31206eeb0e72b1987f38bc21f): Bind for 0.0.0.0:8080 failed: port is already allocated.
docker@default:~/tomcat/webapps$ ps -a
  PID TTY          TIME CMD
 8931 ttyS0    00:00:00 sleep
 8932 pts/1    00:00:00 ps
docker@default:~/tomcat/webapps$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                    NAMES
d468440ecd26        tomcat              "catalina.sh run"   24 seconds ago      Created                                      tomcat7.0.56
a5e09d9cf366        tomcat              "catalina.sh run"   15 hours ago        Up 15 hours         0.0.0.0:8080->8080/tcp   tomcat
docker@default:~/tomcat/webapps$
docker@default:~/tomcat/webapps$ docker run --name tomcat7.0.56_1 -p 7070:7070 -v /home/docker/tomcat/webapps:/home/docker/tomcat/webapps -d tomcat
1c3ba8dbb13a74a45072d1266e5309f1fe71860910c1db73b2c59f294ca3d624
docker@default:~/tomcat/webapps$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                              NAMES
1c3ba8dbb13a        tomcat              "catalina.sh run"   8 seconds ago       Up 6 seconds        0.0.0.0:7070->7070/tcp, 8080/tcp   tomcat7.0.56_1
d468440ecd26        tomcat              "catalina.sh run"   4 minutes ago       Created                                                tomcat7.0.56
a5e09d9cf366        tomcat              "catalina.sh run"   15 hours ago        Up 15 hours         0.0.0.0:8080->8080/tcp             tomcat
docker@default:~/tomcat/webapps$ docker rm d468440ecd263ae7be2f39b79d8d8134da352fad27cb58bd2ead0501c4ec7361
d468440ecd263ae7be2f39b79d8d8134da352fad27cb58bd2ead0501c4ec7361
docker@default:~/tomcat/webapps$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED              STATUS              PORTS                              NAMES
1c3ba8dbb13a        tomcat              "catalina.sh run"   About a minute ago   Up About a minute   0.0.0.0:7070->7070/tcp, 8080/tcp   tomcat7.0.56_1
a5e09d9cf366        tomcat              "catalina.sh run"   15 hours ago         Up 15 hours         0.0.0.0:8080->8080/tcp             tomcat
docker@default:~/tomcat/webapps$ docker rm a5e09d9cf366
Error response from daemon: You cannot remove a running container a5e09d9cf366b87928512c40c71464a272505f9bd7b471c3ad6b724a9d1949fc. Stop the container before attempting removal or force remove
docker@default:~/tomcat/webapps$ docker stop tomcat
tomcat
docker@default:~/tomcat/webapps$ docker rm tomcat
tomcat
docker@default:~/tomcat/webapps$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                              NAMES
1c3ba8dbb13a        tomcat              "catalina.sh run"   3 minutes ago       Up 3 minutes        0.0.0.0:7070->7070/tcp, 8080/tcp   tomcat7.0.56_1
docker@default:~/tomcat/webapps$ docker restart tomcat7.0.56_1
tomcat7.0.56_1
docker@default:~/tomcat/webapps$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                              NAMES
1c3ba8dbb13a        tomcat              "catalina.sh run"   4 minutes ago       Up 5 seconds        0.0.0.0:7070->7070/tcp, 8080/tcp   tomcat7.0.56_1
docker@default:~/tomcat/webapps$ ifconfig
docker0   Link encap:Ethernet  HWaddr 02:42:BE:B0:BE:8B
          inet addr:172.17.0.1  Bcast:172.17.255.255  Mask:255.255.0.0
          inet6 addr: fe80::42:beff:feb0:be8b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:93 errors:0 dropped:0 overruns:0 frame:0
          TX packets:109 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:9505 (9.2 KiB)  TX bytes:8447 (8.2 KiB)

eth0      Link encap:Ethernet  HWaddr 08:00:27:88:69:7E
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe88:697e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:619795 errors:0 dropped:0 overruns:0 frame:0
          TX packets:124223 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:770383884 (734.6 MiB)  TX bytes:7712334 (7.3 MiB)

eth1      Link encap:Ethernet  HWaddr 08:00:27:37:FB:DB
          inet addr:192.168.99.100  Bcast:192.168.99.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe37:fbdb/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7118 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6219 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:642841 (627.7 KiB)  TX bytes:1094104 (1.0 MiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

veth2566b30 Link encap:Ethernet  HWaddr FE:CD:9A:86:86:22
          inet6 addr: fe80::fccd:9aff:fe86:8622/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:836 (836.0 B)

docker@default:~/tomcat/webapps$ cd /home/docker/tomcat/webapps
docker@default:~/tomcat/webapps$ ls
1.txt
docker@default:~/tomcat/webapps$ docker pa -a
unknown shorthand flag: 'a' in -a
See 'docker --help'.

Usage:  docker [OPTIONS] COMMAND

A self-sufficient runtime for containers

Options:
      --config string      Location of client config files (default "/home/docker/.docker")
  -c, --context string     Name of the context to use to connect to the daemon (overrides DOCKER_HOST env var and default context set with "docker
                           context use")
  -D, --debug              Enable debug mode
  -H, --host list          Daemon socket(s) to connect to
  -l, --log-level string   Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info")
      --tls                Use TLS; implied by --tlsverify
      --tlscacert string   Trust certs signed only by this CA (default "/home/docker/.docker/ca.pem")
      --tlscert string     Path to TLS certificate file (default "/home/docker/.docker/cert.pem")
      --tlskey string      Path to TLS key file (default "/home/docker/.docker/key.pem")
      --tlsverify          Use TLS and verify the remote
  -v, --version            Print version information and quit

Management Commands:
  builder     Manage builds
  config      Manage Docker configs
  container   Manage containers
  context     Manage contexts
  engine      Manage the docker engine
  image       Manage images
  network     Manage networks
  node        Manage Swarm nodes
  plugin      Manage plugins
  secret      Manage Docker secrets
  service     Manage services
  stack       Manage Docker stacks
  swarm       Manage Swarm
  system      Manage Docker
  trust       Manage trust on Docker images
  volume      Manage volumes

Commands:
  attach      Attach local standard input, output, and error streams to a running container
  build       Build an image from a Dockerfile
  commit      Create a new image from a container's changes
  cp          Copy files/folders between a container and the local filesystem
  create      Create a new container
  diff        Inspect changes to files or directories on a container's filesystem
  events      Get real time events from the server
  exec        Run a command in a running container
  export      Export a container's filesystem as a tar archive
  history     Show the history of an image
  images      List images
  import      Import the contents from a tarball to create a filesystem image
  info        Display system-wide information
  inspect     Return low-level information on Docker objects
  kill        Kill one or more running containers
  load        Load an image from a tar archive or STDIN
  login       Log in to a Docker registry
  logout      Log out from a Docker registry
  logs        Fetch the logs of a container
  pause       Pause all processes within one or more containers
  port        List port mappings or a specific mapping for the container
  ps          List containers
  pull        Pull an image or a repository from a registry
  push        Push an image or a repository to a registry
  rename      Rename a container
  restart     Restart one or more containers
  rm          Remove one or more containers
  rmi         Remove one or more images
  run         Run a command in a new container
  save        Save one or more images to a tar archive (streamed to STDOUT by default)
  search      Search the Docker Hub for images
  start       Start one or more stopped containers
  stats       Display a live stream of container(s) resource usage statistics
  stop        Stop one or more running containers
  tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
  top         Display the running processes of a container
  unpause     Unpause all processes within one or more containers
  update      Update configuration of one or more containers
  version     Show the Docker version information
  wait        Block until one or more containers stop, then print their exit codes

Run 'docker COMMAND --help' for more information on a command.

docker@default:~/tomcat/webapps$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                              NAMES
1c3ba8dbb13a        tomcat              "catalina.sh run"   11 minutes ago      Up 6 minutes        0.0.0.0:7070->7070/tcp, 8080/tcp   tomcat7.0.56_1
docker@default:~/tomcat/webapps$ docker stop tomcat7.0.56_1
tomcat7.0.56_1
docker@default:~/tomcat/webapps$ docker rm tomcat7.0.56_1
tomcat7.0.56_1
docker@default:~/tomcat/webapps$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
tomcat              latest              bf4709e77b18        13 days ago         667MB
tomcat              7.0.56              efe1a0718e60        6 years ago         353MB
docker@default:~/tomcat/webapps$ docker rmi bf4709e77b18
Untagged: tomcat:latest
Untagged: tomcat@sha256:076f0048b1340813301852336c32628e7b351202f8ece983717bbb91046e2a62
Deleted: sha256:bf4709e77b18c34d3f1474c61433114c9e2f8c92963462a6689683f3ddefbc20
Deleted: sha256:cf99e4f97c49cba9d38a4b605fb1d9c78c69df64e2dd6c92c3cc510dc323f392
Deleted: sha256:fc8f0f8dec316dd6cd9b90b7d8d83a2202111e9b00dbee253fc4557e01fbed50
Deleted: sha256:769b134e65d4ab9166d9c0f001fac5c2b89fc92d81f68769bad67d09f4dc019d
Deleted: sha256:ed01232889798b88da17d8addd27587b50e2dc00338604ddb6f0c42c81384f66
Deleted: sha256:94172d5e19c476da2c2ec59b5bcd3c74b3dbbf4ba71d0322124bd7d175eb8547
Deleted: sha256:72623bb68a7b54c8d5a35a4a9720a7d43fbcbd64ae3f2fb2383a65d629f96b84
Deleted: sha256:e659b0af17afc5394fc283994bf1de70bed6f0e4c6b293df3a208892aea8f8f8
Deleted: sha256:222ce182141cd6c40655dd68f34fe4b8c9fcca30fe5767fea1ba30d84d5a2f07
Deleted: sha256:1ca91dc41a40b644015fa1fa4bd0a87c793296a1f7e9ab34548974889525dbcb
Deleted: sha256:7f03bfe4d6dc12155877f0d2e8b3429090bad1af7b005f75b7b3a874f386fd5a
docker@default:~/tomcat/webapps$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
tomcat              7.0.56              efe1a0718e60        6 years ago         353MB
docker@default:~/tomcat/webapps$ pwd
/home/docker/tomcat/webapps
docker@default:~/tomcat/webapps$ docker run --name tomcat_zwf -p 7070:7070 -v $PWD/test:/usr/local/tomcat/webapps/test -d tomcat
Unable to find image 'tomcat:latest' locally
latest: Pulling from library/tomcat
0ecb575e629c: Downloading [=====================>                             ]  21.39MB/50.4MB
0ecb575e629c: Downloading [==============================>                    ]  30.56MB/50.4MB
feab2c490a3c: Download complete
f15a0f46f8c3: Downloading [==>                                                ]  2.096MB/51.83MB
f15a0f46f8c3: Downloading [=======>                                           ]  7.871MB/51.83MB
242c5446d23f: Waiting
f22708c7c9c1: Waiting
d8b7e17ca4bc: Waiting
91588c31829d: Waiting
d97abf351b5d: Waiting
docker run --name tomcat_zwf -p 7070:7070 -v $PWD/test:/usr/local/tomcat/webapps/test -d tomcat
^C
docker@default:~/tomcat/webapps$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
tomcat              7.0.56              efe1a0718e60        6 years ago         353MB
docker@default:~/tomcat/webapps$ docker run -d -p 7070:7070 tomcat
Unable to find image 'tomcat:latest' locally
latest: Pulling from library/tomcat
0ecb575e629c: Pull complete
7467d1831b69: Pull complete
feab2c490a3c: Pull complete
f15a0f46f8c3: Pull complete
26cb1dfcbebb: Pull complete
242c5446d23f: Pull complete
f22708c7c9c1: Downloading [======>                                            ]  28.08MB/202.8MB
d8b7e17ca4bc: Download complete
91588c31829d: Download complete
d97abf351b5d: Download complete
^C
docker@default:~/tomcat/webapps$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
tomcat              7.0.56              efe1a0718e60        6 years ago         353MB
docker@default:~/tomcat/webapps$ docker tag efe1a0718e60 tomcat7.0.56 latest
"docker tag" requires exactly 2 arguments.
See 'docker tag --help'.

Usage:  docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]

Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
docker@default:~/tomcat/webapps$ docker tag efe1a0718e60 tomcat7.0.56:latest
docker@default:~/tomcat/webapps$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
tomcat7.0.56        latest              efe1a0718e60        6 years ago         353MB
tomcat              7.0.56              efe1a0718e60        6 years ago         353MB
docker@default:~/tomcat/webapps$ docker images efe1a0718e60
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
docker@default:~/tomcat/webapps$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
tomcat7.0.56        latest              efe1a0718e60        6 years ago         353MB
tomcat              7.0.56              efe1a0718e60        6 years ago         353MB
docker@default:~/tomcat/webapps$ docker rmi efe1a0718e60
Error response from daemon: conflict: unable to delete efe1a0718e60 (must be forced) - image is referenced in multiple repositories
docker@default:~/tomcat/webapps$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
docker@default:~/tomcat/webapps$ docker rmi tomcat:7.0.56
Untagged: tomcat:7.0.56
Untagged: tomcat@sha256:5f2d634a9ac433da0d11a8260a50495aa2bb8f8edd29289b995a481a7d3e73a4
docker@default:~/tomcat/webapps$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
tomcat7.0.56        latest              efe1a0718e60        6 years ago         353MB
docker@default:~/tomcat/webapps$ docker run --name tomcat_zwf -p 7070:7070 -v $PWD/test:/usr/local/tomcat/webapps/test -d tomcat
Unable to find image 'tomcat:latest' locally
latest: Pulling from library/tomcat
0ecb575e629c: Pulling fs layer
7467d1831b69: Pulling fs layer
feab2c490a3c: Waiting
f15a0f46f8c3: Waiting
26cb1dfcbebb: Waiting
242c5446d23f: Waiting
f22708c7c9c1: Waiting
d8b7e17ca4bc: Waiting
91588c31829d: Waiting
d97abf351b5d: Waiting
^C
docker@default:~/tomcat/webapps$ docker tag efe1a0718e60 tomcat:latest
docker@default:~/tomcat/webapps$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
tomcat7.0.56        latest              efe1a0718e60        6 years ago         353MB
tomcat              latest              efe1a0718e60        6 years ago         353MB
docker@default:~/tomcat/webapps$ docker rmi tomcat7.0.56:latest
Untagged: tomcat7.0.56:latest
docker@default:~/tomcat/webapps$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
tomcat              latest              efe1a0718e60        6 years ago         353MB
docker@default:~/tomcat/webapps$ docker run --name tomcat_zwf -p 7070:7070 -v $PWD/test:/usr/local/tomcat/webapps/test -d tomcat
e7676447c23ea5aeb2d31589fcf935b744e2e4786d2164e46424aec4c162042d
docker@default:~/tomcat/webapps$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                              NAMES
e7676447c23e        tomcat              "catalina.sh run"   11 seconds ago      Up 9 seconds        0.0.0.0:7070->7070/tcp, 8080/tcp   tomcat_zwf
docker@default:~/tomcat/webapps$

 

你可能感兴趣的:(tomcat)