https://github.com/artemmkin/docker-multi-stage
https://github.com/artemmkin/docker-multi-stage
docker docker-builder
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/artemmkin/docker-multi-stage
- Owner: Artemmkin
- Created: 2017-10-16T07:22:12.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-09-02T05:26:37.000Z (about 5 years ago)
- Last Synced: 2025-04-03T09:11:59.920Z (6 months ago)
- Topics: docker, docker-builder
- Language: Go
- Size: 1.95 KB
- Stars: 2
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Example of Docker multi-stage build
1. Build the container image
```bash
$ docker build -t artemmkin/hello-world:latest .
```
2. Check the built image size
```bash
$ docker images | grep artemmkin/hello-worldartemmkin/hello-world latest 08e186387598 14 minutes ago 10.1MB
```
3. Run a container from the image
```bash
$ docker run -d -p 8000:8000 --rm --name hello-app artemmkin/hello-world
```
4. Check that the application works
```bash
$ curl localhost:8000
```
5. Clean up
```bash
$ docker stop hello-app
```## Compare to the one container build
1. Build the container image
```bash
$ docker build -t artemmkin/hello-world:latest . -f Dockerfile.onebuild
```
2. Check the built image size
```bash
$ docker images | grep artemmkin/hello-worldartemmkin/hello-world latest 964ba43fcec3 9 seconds ago 740MB
```