Skip to content

Artemmkin/docker-multi-stage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages