-
Notifications
You must be signed in to change notification settings - Fork 422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't rebuild everything after even slightest change #1672
Comments
Hi @iirekm, I'm not sure why iterating over each You can use |
Something like: ADD install-feature-1.sh
RUN install-feature-1.sh
ADD install-feature-2.sh
RUN install-feature-2.sh
ADD install-feature-3.sh
RUN install-feature-3.sh Is much faster than putting all at once, because if I reconfigure only feature 3, only the last layer has to be rebuilt. Most developers expect that the most experimental things, that are most likely to change or be reconfigured soon, should be put at end of Dockerfile, the most stable or the biggest ones - at top of Dockerfile. The same should probably be true for Another easy to apply optimization technique is --mount to avoid re-downloading .deb, .whl and other files even if a layer has to be rebuilt, for example: I know I can create own Dockerfiles (and I actually now do to address the performance issues above), but this requires lots of copy and paste between projects. Devcontainers features were created to improve reusability. So to sum up, something like the following should help a lot: ADD install-feature-1.sh
RUN --mounts for all popular package managers install-feature-1.sh
ADD install-feature-2.sh
RUN--mounts for all popular package managers install-feature-2.sh
ADD install-feature-3.sh
RUN --mounts for all popular package managers install-feature-3.sh |
The line
COPY ./.devpod-internal/ /tmp/build-features/
in generated Dockerfile makes full rebuild even after tiniest changes in devcontainer.json. This is unprzctical. Why not add./.devpod-internal/0
then./.devpod-internal/1
and so on???Enabling cache for apt, npm, pip, and similar commands (with RUN --mount) would also help a lot. Currently devpod image building is slow, so slow that it's almost useless to me and I have to switch to competition.
The text was updated successfully, but these errors were encountered: