: 개발 및 배포, 서비스 운영에 있어서 실행환경, 코드, 라이브러리, 설정 파일 등을 쉽게 관리하기위한 도구
Docker is a set of platform as a service (PaaS) products that use OS-level virtualization to deliver software in packages called containers.
-Docker (software) from Wikipedia
docker의 구성요소 (출처: https://docs.docker.com/get-started/overview/)
: 애플리케이션의 개발, 실행, 배포 등을 위해 표준화된 단위의 패키지
Package Software into Standardized Units for Development, Shipment and Deployment
A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another.
- www.doker.com/resources/what-container/
: 컨테이너를 빌드하는 데 사용되는 읽기 전용 템플릿, 애플리케이션을 저장하고 배송(ship)하는데 사용됨
A Docker image is a read-only template used to build containers. Images are used to store and ship applications.
- Docker (software) from Wikipedia
: Docker image들을 업로드(push)하고 다운로드(pull)받기위한 공간
A Docker registry is a repository for Docker images. Docker clients connect to registries to download ("pull") images for use or upload ("push") images that they have built.
- Docker (software) from Wikipedia
: container 생성
docker run [options] {image_name} [command]
docker run -d -p 80:5000 docker-memo:version1
: container 정지
docker stop {container_id|conatinaer_name}
docker stop docker-memo:version1
: container 재시작
docker restart {container_id|container_name}
docker restart docker-memo:version1
: container 삭제
docker rm {container_id}
docker rm 66adafa8f672
: Docker image를 생성하기위한 파일
FROM python:3.8 ADD requirements.txt . RUN pip install -r requirements.txt ADD templates templates ADD app.py . CMD ["python", "app.py"]
docker build [OPTIONS] PATH
docker build -t docker-memo:version1 .
: Docker image 목록 확인 가능
: Docker image 삭제
docker rmi ({image_name}:{tag} | {Iamge ID})
docker rmi docker-memo:version1
: Docker registry를 관리할 수 있는 서비스
Docker Hub is a service provided by Docker for finding and sharing container images with your team. It is the world’s largest repository of container images with an array of content sources including container community developers, open source projects and independent software vendors (ISV) building and distributing their code in containers.
- https://docs.docker.com/docker-hub/
: docker hub의 가입한 아이디(user_id)를 포함
docker build -t {user_id}/docker-memo:version2 .
docker build -t kimphysicsman/docker-memo:version2 .
docker login
docker push {user_id}/docker-memo:version2
docker push kimphysicsman/docker-memo:version2