Skip to content
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

Move the stack args to just before they are needed #39

Merged
merged 2 commits into from
May 13, 2021

Conversation

AlistairB
Copy link
Contributor

@AlistairB AlistairB commented May 10, 2021

This increases layer cacheability so that new stack versions will not invalidate the ghc / cabal install layer. As noted by @yosifkit docker-library/official-images#10140 (comment)

You could maximise layer caching further by moving the ghc / stack required packages ie. g++ to the initial apt-get install, which would mean new cabal versions would not invalidate these packages from being installed (or from the user's perspective, the invalidated layers they need to redownload are smaller). My inclination would be to do this change as well, or perhaps the current logical grouping has value? Any thoughts @psftw ?

EDIT: Hmm investigating the failure.. ok seems to have been a flaky gpg issue, or a caching issue. Rerunning fixed it.

This increases layer cacheability so that new stack versions will not
invalide the ghc / cabal install layer.
@AlistairB AlistairB requested a review from psftw May 10, 2021 22:52
@psftw
Copy link
Contributor

psftw commented May 11, 2021

Thanks again. This is a solid improvement, and your suggestion to optimize the apt bits further is also legit. I like the change more for a different reason: it makes the Dockerfile clearer about which packages came from which repositories. Anything NOT from haskell.org repos could be put in the first install. Happy to take another look if you do it, otherwise I'm good with this as-is if not. 🍻

@AlistairB
Copy link
Contributor Author

AlistairB commented May 11, 2021

Sounds good :) I've made the additional change. I probably wouldn't worry about doing a release for this change btw. Just wait until something gets bumped and then do a release.

@@ -3,7 +3,20 @@ FROM debian:buster
ENV LANG C.UTF-8

RUN apt-get update && \
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr && \
apt-get install -y --no-install-recommends \
gnupg \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick -- indent and sort by name to be consistent 🤓

@AlistairB
Copy link
Contributor Author

Good call! Updated.

@psftw psftw merged commit 0265de2 into haskell:master May 13, 2021
@AlistairB AlistairB deleted the move-stack-args branch July 24, 2021 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants