-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Refactor Dockerfile #1632
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
Refactor Dockerfile #1632
Conversation
Maybe sync this with #1615 |
I was planning and updating and cleaning Dockerfile for alpine part, following https://github.com/gliderlabs/docker-alpine/blob/master/docs/usage.md, for example adding also |
Okay, just to confirm, so what I need to do here is to use |
Please add I would also prefer to not add a stage by splitting RUN instruction and keep it together. |
What's the reason why here to combine two unrelated things into a single layer? I didn't see a good point here. |
1. Use `apk -U --no-cache add` instead of `apk update` + `apk add` + manually cache clean up. 2. Separate package installation and user, group setup, the combination to reduce a docker image layer didn't bring benefits here, only makes Dockerfiles more complex.
0d6f7a6
to
b07dfcc
Compare
I'm fine with this change. Concatenating the layers only makes sense if we're removing build-deps in the end. LGTM |
LGTM |
Oh I forget the -U is useless with --no-cache but this could also be merged with it. |
apk -U add
instead ofapk update
+apk add
to reduce a docker image layer didn't bring benefits here.