You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 22, 2023. It is now read-only.
I guess, we could combine the advantages of both methods script and Dockerfile.
Multi-stage builds are a new feature in Docker 17.05. With multi-stage builds, you use multiple FROM statements in your Dockerfile. Each FROM instruction can use a different base, and each of them begins a new stage of the build. You can selectively copy artifacts from one stage to another, leaving behind everything you don’t want in the final image. https://docs.docker.com/engine/userguide/eng-image/multistage-build/
An applications Dockerfile might look like
FROM aedm/minimeteor:1.5.2-build # debian and alpine-node with build-deps
FROM aedm/minimeteor:1.5.2-production # alpine-node minimal
COPY --from=0 /bundle .
This way, we would not need to install dependencies and meteor on every build and still have a minimal-weight image in the end 🙃
I have not tried out how to combine the new COPY --from and ONBUILD though. But I hope, that works.