본문 바로가기
Cloud/Google Cloud Study Jam

Kubernetes in Google Cloud #1

by 사향낭 2022. 7. 9.

Introduction to Docker

 

 

Docker은 application을 개발하고, 옮기고, 돌리기 위한 open platform이다.

 

Infrastructure과 application을 분리할 수 있는데, Windows 위에서 Linux를 돌리는 것처럼 현재의 환경과 application이 원하는 환경이 다를 때에도 쉽게 해당 application을 쉽게 돌릴 수 있다.

 

 

docker run specific-name

 

Docker에게 특정 container를 실행시키도록 시킨다.

 

Docker daemon은 먼저 local에서 특정 container image가 있는지를 찾는다.

 

만약 없다면 Docker Hub라 불리는 공공 저장소에서 그 image를 가져와 이를 토대로 container를 만들어 돌린다.

 

 

docker images

 

가장 최근에 생성된 container image를 확인할 수 있다.

 

 

docker ps [-a]

 

running container list를 확인할 수 있다.

 

-a tag를 붙이면 실행이 끝난 container까지 확인할 수 있다.

 

 

Dockerfile으로 container image를 만들 수 있다. (c program의 makefile과 같이)

 

 

container를 돌리고, 중단하고, 삭제할 수 있다.

 

로그도 확인할 수 있다. (일반적인 application을 돌리는 것과 유사하다.)

 

 

docker push name:tag

 

Google Container Registry (gcr)에 local에만 있는 container image를 push 할 수도, gcr에 있는 container image를 local에 pull 할 수도 있다.

 

 

 

댓글