본문 바로가기
프로그래밍/Docker

Docker 기본 개념

by 만디기 2024. 5. 29.

1) Docker 공식 문서 :

https://docs.docker.com/

 

Home

Docker Documentation is the official Docker library of resources, manuals, and guides to help you containerize applications.

docs.docker.com

 

 

2) Dockerfile : 

- A Dockerfile is a text-based document that's used to create a container image. It provides instructions to the image builder on the commands to run, files to copy, startup command, and more. (Docker 공식 문서)

 

- docker build 명령어로 Dockerfile에 명시된 작업을 수행하여 이미지를 만들 수 있다.

 

 

예시

#
# ubuntu - Dockerfile test
#
# build :
#       docker build --force-rm -t (image name)
#       docker build (Dockerfile 위치)
# run :
#       docker run

FROM ubuntu:18.04
LABEL maintainer="tester"
LABEL description="Dockerfile test"

RUN apt-get update
RUN apt-get install apt-file -y
RUN apt-file update

RUN apt-get install vim -y