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 has been 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.
The text was updated successfully, but these errors were encountered:
Yes, multi-stage builds are definitely the future of Minimeteor. I'd actually be really glad not having to support two different build mechanisms. :)
What I can't really figure out yet is how to select base images dynamically. I want to specify mhart/alpine-node:x.x based on the output of meteor build, since it specifies the Node version required to run the bundle. What you suggested above would work, but it would also require the user to update the Dockerfile every time the Meteor version is upgraded. Still, that would probably be a good start.
I'm still lamenting about this. Any suggestions are welcome.
True, that would be much nicer.
I could only imagine to take a plain alpine, COPY --from from the meteor build-image and install the corresponding node version ONBUILD. But - for me - it's not worth the increased build-time. We build our apps every few hours and update meteor just every few weeks ...
Now that I think about it - I guess, we could hide all three steps inside one image. So my example above could be stripped down to one statement:
FROM aedm/minimeteor:1.5.2 # debian, alpine-node with build-deps and finally: alpine-node minimal
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I guess, we could combine the advantages of both methods
script
andDockerfile
.An applications Dockerfile might look like
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
andONBUILD
though. But I hope, that works.The text was updated successfully, but these errors were encountered: