[{TableOfContents }]


!! 2.1 도커 이미지와 컨테이너


!! 2.2 도커 컨테이너 다루기

! 2.2.1 컨테이너 생성

%%prettify 
{{{
C:\Users\USER>docker -v
Docker version 19.03.5, build 633a0ea
}}}
/%


%%prettify 
{{{
C:\Users\USER>docker run -i -t ubuntu:14.04
Unable to find image 'ubuntu:14.04' locally
14.04: Pulling from library/ubuntu
2e6e20c8e2e6: Pull complete                                                                                             30bb187ac3fc: Pull complete                                                                                             b7a5bcc4a58a: Pull complete                                                                                             Digest: sha256:ffc76f71dd8be8c9e222d420dc96901a07b61616689a44c7b3ef6a10b7213de4
Status: Downloaded newer image for ubuntu:14.04
root@917fadba2e62:/# ls
bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
root@917fadba2e62:/# exit
exit
}}}
/%


%%prettify 
{{{
C:\Users\USER>docker pull centos:7
7: Pulling from library/centos
ab5ef0e58194: Pull complete                                                                                             Digest: sha256:4a701376d03f6b39b8c2a8f4a8e499441b0d567f9ab9d58e4991de4472fb813c
Status: Downloaded newer image for centos:7
docker.io/library/centos:7
}}}
/%


%%prettify 
{{{
C:\Users\USER>docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
ubuntu              14.04               6e4f1fe62ff1        3 weeks ago         197MB
centos              7                   5e35e350aded        2 months ago        203MB
}}}
/%


%%prettify 
{{{
C:\Users\USER>docker create -i -t --name mycentos centos:7
e33ef143702a08f1ae56ee3f7ae2d058c96fa934630e681df57119860d963e7b

C:\Users\USER>docker start mycentos
mycentos

C:\Users\USER>docker container ls
CONTAINER ID        IMAGE               COMMAND             CREATED              STATUS              PORTS               NAMES
e33ef143702a        centos:7            "/bin/bash"         About a minute ago   Up 7 seconds                            mycentos

C:\Users\USER>docker attach mycentos
[root@e33ef143702a /]#  
}}}
/%
                         


docker run 명령어
* pull
* create
* start
* attach

!! 2.3 도커 이미지


!! 2.4 Dockerfile


!! 2.5 도커 데몬