maintainer 쓰지마 deprecated use Label
레이어별 캐싱이 된다면 빌드마다 달라지는 레이어를 최소화하고 공통 도커 레이어두기
Dockerfile Commands
Dockerfile practice
- non root user
- only executable & not writable
- use minimal image
- only expose service port
- use docker secret or k8s secret
- dockerignore
- minimalize layer(constructions)
- layer 순서 잘 고려하기 cache
Docker ARG, ENV and .env - a Complete Guide
Error: Docker image build failed. Building Docker images and configuring your dockerized apps doesn't have to be a try-fail-repeat Google extravaganza. This article will help you work with Docker ARG, ENV, env_file and .env files with confidence. The only prerequisite: make sure that you're comfortable with the basics of Docker.
https://vsupalov.com/docker-arg-env-variable-guide/

ARG 와 ENV 의 차이점
ARG [= ] ARG centos_version=7 ARG nginx_version 이미지 빌드를 위해 Dockerfile 내에서 사용하기 위한 값. 빌드 시점에서 사용, 그러므로 설정을 유지하지 않으려면 ARG 사용 docker build 명령어에 --build-arg 옵션으로 전달하거나 덮어쓸 수 있음 docker build . \ --no-cache \ -t nginx:latest \ -t nginx:${nginx_version}-$(date +"%y%m%d") \ --build-arg CENTOS_VERSION=${centos_version} \ --build-arg NGINX_VERSION=${nginx_version} \ --build-arg NVAUTH_VERSION=${nvauth_version} FROM 이전에 있는 ARG 는 FROM 에서만 사용 가능하다.
https://wickso.me/docker/arg-vs-env/
3 simple tricks for smaller Docker images
When it comes to building Docker containers, you should always strive for smaller images. Images that share layers and are smaller in size are quicker to transfer and deploy. But how do you keep the size under control when every RUN statement creates a new layer, and you need intermediate artefacts before the image is ready?
https://learnk8s.io/blog/smaller-docker-images?fbclid=IwAR2sm4G9BYEsFHCFdwXIv-lzmjB36GegfZocD-yZMoEy8fxHyJn0XSdjRYU



Seonglae Cho