Docker container 빌드

Docker container 빌드

Part 1: Containerize an application 참고하여 아래 repo의 파일 받음. (소스코드에 port 3000번 사용하도록 되어 있음)

getting-started/app at master · docker/getting-started

$ cat Dockerfile FROM node:12-alpine RUN apk add --no-cache python g++ make WORKDIR /app COPY . . RUN yarn install --production CMD ["node", "src/index.js"]

컨테이너 빌드하고 확인

docker build -t getting-started . docker run -dp 3000:3000 getting-started curl http://localhost:3000

 

관련자료

docker buildx build

docker image push

Best practices