왕초보도 따라하는 도커 기초

도커 소개

Untitled


도커 설치하기


내가 원하는 이미지 찾기 도커 레지스트리

docker search tomcat
docker pull tomcat

도커 라이프사이클 이해하기

Untitled


도커 라이프사이클 명령어 실습

docker pull nginx
>>> Using default tag: latest
latest: Pulling from library/nginx
26c5c85e47da: Pull complete 
4f3256bdf66b: Pull complete 
2019c71d5655: Pull complete 
8c767bdbc9ae: Pull complete 
78e14bb05fd3: Pull complete 
75576236abf5: Pull complete 
Digest: sha256:63b44e8ddb83d5dd8020327c1f40436e37a6fffd3ef2498a6204df23be6e7e94
Status: Downloaded newer image for nginx:latest
docker.io/library/nginx:latest
docker create -p 80:80 --name nx nginx
>>> b3655de307743575ad2942d68b960d017ec9b28b723dc0a7d9eadb66bd7978c0
docker ps -a
>>> CONTANER ID   IMAGE     COMMAND                  CREATED             STATUS             PORTS                                       NAMES
b3655de30774   nginx     "/docker-entrypoint.…"   50 seconds ago      Created                                                        nx
46dded6ec9f4   tomcat    "catalina.sh run"        About an hour ago   Up About an hour   0.0.0.0:8080->8080/tcp, :::8080->8080/tcp   tc
docker start nx
docker start b3655de30774
>>> nx
docker ps
>>> CONTAINER ID   IMAGE     COMMAND                  CREATED              STATUS             PORTS                                       NAMES
b3655de30774   nginx     "/docker-entrypoint.…"   About a minute ago   Up 3 seconds       0.0.0.0:80->80/tcp, :::80->80/tcp           nx
46dded6ec9f4   tomcat    "catalina.sh run"        About an hour ago    Up About an hour   0.0.0.0:8080->8080/tcp, :::8080->8080/tcp   tc

이미지 비밀 레이어


도커의 유용한 명령어