aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrett Randall <javabrett@gmail.com>2017-12-19 11:01:21 +1100
committerManuel Rüger <manuel@rueg.eu>2017-12-19 10:58:37 +0100
commitaa6fab56bef9c3836068bac69355e7f84f183e10 (patch)
treee612aad8d02f03107edcd85129196822d83d1a19
parentRemoved trailing / in DIST, made STAGEPATH more verbose. Removed -c from wget-s. (diff)
downloaddocker-images-aa6fab56bef9c3836068bac69355e7f84f183e10.tar.gz
docker-images-aa6fab56bef9c3836068bac69355e7f84f183e10.tar.bz2
docker-images-aa6fab56bef9c3836068bac69355e7f84f183e10.zip
Added a multi-stage build example using portage to README.md.
Fixed #35.
-rw-r--r--README.md21
1 files changed, 21 insertions, 0 deletions
diff --git a/README.md b/README.md
index 3ceb3b1..5e24bf9 100644
--- a/README.md
+++ b/README.md
@@ -37,6 +37,27 @@ docker create -v /usr/portage --name myportagesnapshot gentoo/portage:latest /bi
docker run --volumes-from myportagesnapshot gentoo/stage3-amd64:latest /bin/bash
```
+# Using the portage container in a multi-stage build
+
+docker-17.05.0 or later supports multi-stage builds, allowing the portage volume to be used when creating images based on a stage3 image.
+
+Example _Dockerfile_
+
+```
+# name the portage image
+FROM gentoo/portage:latest as portage
+
+# image is based on stage3-amd64
+FROM gentoo/stage3-amd64:latest
+
+# copy the entire portage volume in
+COPY --from=portage /usr/portage /usr/portage
+
+# continue with image build ...
+RUN emerge -qv www-servers/apache # or whichever packages you need
+```
+
+
# Contributing
We'd love to hear any ideas. Feel free to contact us via any of the following