"카타코더 Docker - Building Container Images"의 두 판 사이의 차이

(새 문서: ==개요== {{Katacoda|Docker & Containers|1}} ==Creating a Dockerfile== {{소스헤더|index.html}} <source lang='html'> <h1>Hello World</h1> </source> {{소스헤더|Dockerfile}} <s...)
 
51번째 줄: 51번째 줄:
nginx              1.11-alpine        bedece1f06cc        23 months ago      54.3MB
nginx              1.11-alpine        bedece1f06cc        23 months ago      54.3MB
</source>
</source>
==같이 보기==
* [[docker images]]
* [[docker build]]

2019년 3월 23일 (토) 00:08 판

1 개요

틀:Katacoda

2 Creating a Dockerfile

index.html
<h1>Hello World</h1>
Dockerfile
FROM nginx:1.11-alpine
COPY index.html /usr/share/nginx/html/index.html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

3 Building Containers

$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
$ docker build -t nginx .
Sending build context to Docker daemon  3.072kB
Step 1/4 : FROM nginx:1.11-alpine
1.11-alpine: Pulling from library/nginx
709515475419: Pull complete
4b21d71b440a: Pull complete
c92260fe6357: Pull complete
ed383a1b82df: Pull complete
Digest: sha256:5aadb68304a38a8e2719605e4e180413f390cd6647602bee9bdedd59753c3590
Status: Downloaded newer image for nginx:1.11-alpine
 ---> bedece1f06cc
Step 2/4 : COPY index.html /usr/share/nginx/html/index.html
 ---> ff82266f8a3c
Step 3/4 : EXPOSE 80
 ---> Running in 75539b6235b5
Removing intermediate container 75539b6235b5
 ---> b06ce6726b2a
Step 4/4 : CMD ["nginx", "-g", "daemon off;"]
 ---> Running in df877b3d066b
Removing intermediate container df877b3d066b
 ---> a2272ce5f857
Successfully built a2272ce5f857
Successfully tagged nginx:latest
$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
nginx               latest              a2272ce5f857        7 seconds ago       54.3MB
nginx               1.11-alpine         bedece1f06cc        23 months ago       54.3MB

4 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}