3 ms·
You can resolve this by installing, building, and uninstalling in the same RUN command right? I once worked at a place that used some insane setup with images b
by Gigachad 5y ago
You can resolve this by installing, building, and uninstalling in the same RUN command right? I once worked at a place that used some insane setup with images building other images to avoid this but I'm pretty sure the first option works as well.
- CraftThatBlock 5y agoTechnically, yes, but it's much easier to use Dockerfiles like normal (and have the build step is a good environment for development), and copy exactly the files you need for the release stage.
- Harvesterify 5y agoYou could, but the biggest benefit of staged builds (IMHO) is that you can use a heavy base image for the build process (classic Ubuntu for example, where it's easy to add repositories and install dependencies), and a very small image for runtime (i.e. Alpine, busybox). I find that it's easier to debug the build process with a "standard" distribution.