Skip to content

Latest commit

 

History

History
37 lines (32 loc) · 878 Bytes

README.md

File metadata and controls

37 lines (32 loc) · 878 Bytes

Example of Docker multi-stage build

  1. Build the container image
$ docker build -t artemmkin/hello-world:latest .
  1. Check the built image size
$ docker images | grep artemmkin/hello-world

artemmkin/hello-world   latest              08e186387598        14 minutes ago       10.1MB
  1. Run a container from the image
$ docker run -d -p 8000:8000 --rm --name hello-app artemmkin/hello-world
  1. Check that the application works
$ curl localhost:8000
  1. Clean up
$ docker stop hello-app

Compare to the one container build

  1. Build the container image
$ docker build -t artemmkin/hello-world:latest . -f Dockerfile.onebuild
  1. Check the built image size
$ docker images | grep artemmkin/hello-world

artemmkin/hello-world   latest              964ba43fcec3        9 seconds ago       740MB