1$ docker run --name repo alpine/git clone https://github.com/docker/getting-started.git
2$ docker cp repo:/git/getting-started/ .
3
4Unable to find image 'alpine/git:latest' locally
5latest: Pulling from alpine/git
66875df1f5354: Pull complete
71eb88bc83e71: Pull complete
80a50dc9da39b: Pull complete
9Digest: sha256:66b210a97bc07bfd4019826bcd13a488b371a6cbe2630a4b37d23275658bd3f2
10Status: Downloaded newer image for alpine/git:latest
11Cloning into 'getting-started'...
12
13$ docker images
14REPOSITORY TAG IMAGE ID CREATED SIZE
15alpine/git latest 9793ee61fc75 3 months ago 43.4MB
16
17$ docker container ls
18CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
19
20$ cd getting-started
21$ docker build -t docker101tutorial .
22[+] Building 27.2s (27/27) FINISHED
23(...省略...)
24=> exporting to image 0.0s
25=> => exporting layers 0.0s
26=> => writing image sha256:94a1f545e696719558fe2bfa 0.0s
27=> => naming to docker.io/library/docker101tutorial 0.0s
28
29$ docker image
30REPOSITORY TAG IMAGE ID CREATED SIZE
31docker101tutorial latest 94a1f545e696 25 seconds ago 46.5MB
32alpine/git latest 9793ee61fc75 3 months ago 43.4MB
33
34$ docker run -d -p 80:80 --name docker-tutorial docker101tutorial
356fd342210287e029fbe9bcefdaf4e650c9a7ae57f0c12b824508683740e11386
36
37$ docker container ls
38CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
396fd342210287 docker101tutorial "/docker-entrypoint.…" 22 seconds ago Up 21 seconds 0.0.0.0:80->80/tcp docker-tutorial