diff options
author | 2017-12-19 11:01:21 +1100 | |
---|---|---|
committer | 2017-12-19 10:58:37 +0100 | |
commit | aa6fab56bef9c3836068bac69355e7f84f183e10 (patch) | |
tree | e612aad8d02f03107edcd85129196822d83d1a19 | |
parent | Removed trailing / in DIST, made STAGEPATH more verbose. Removed -c from wget-s. (diff) | |
download | docker-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.md | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -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 |