4 ms·
This approach is akin to installing all of the build tooling inside of Docker, then generating the build artifact. I'd think it'd be even slimmer to generate th
by jt2190 7y ago
This approach is akin to installing all of the build tooling inside of Docker, then generating the build artifact. I'd think it'd be even slimmer to generate the build artifact first, then just copy that into the container.
Is there an advantage to building inside of Docker?
- oplav 7y agoWe've found one advantage to be more reproducible builds since you don't have to worry about different versions of build tooling affecting the artifact.
- steve_adams_86 7y agoWouldn't the advantage be consistent build fragments? If you use the build tools outside of docker, you won't get the same repeatable build artifact across different machines (or as your own host system changes). Maybe I'm not understanding you though.
- IanCal 6y ago> I'd think it'd be even slimmer to generate the build artifact first, then just copy that into the container. That's what this is doing. It creates builder containers, uses them to make the artifact and copies it in: FROM nginx:1.17.10-alpine RUN rm -r /usr/share/nginx/html/ COPY --from=builder /app/_site/ /usr/share/nginx/html/ EXPOSE 80 The final image is nginx with the static files copied over.