Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 1.04 KB

README.md

File metadata and controls

30 lines (21 loc) · 1.04 KB

docker-mult-stage-build

Multi-stage builds are a new feature requiring Docker 17.05 or higher on the daemon and client. Multistage builds are useful to anyone who has struggled to optimize Dockerfiles while keeping them easy to read and maintain.

build in dev

docker build --target dev -t python-app:dev .

build in prod

docker build --target prod -t python-app:prod .

Docker Build Kit

DOCKER_BUILDKIT=1 docker build --target dev -t python-app:dev .
DOCKER_BUILDKIT=1 docker build --target prod -t python-app:prod .

references: