-
Notifications
You must be signed in to change notification settings - Fork 39
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
Use busybox from alpine #51
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
ARG ARCH="" | ||
FROM ${ARCH}alpine:latest as alpine | ||
|
||
RUN apk upgrade -U && \ | ||
apk add tzdata ca-certificates | ||
|
||
# Use the busybox.static to avoid dynamic library dependencies. | ||
RUN apk add busybox-static && \ | ||
mv /bin/busybox.static /bin/busybox && \ | ||
/bin/busybox --install -s /bin | ||
|
||
# remove extra package | ||
RUN apk del libc-utils | ||
|
||
# remove apk files and directories | ||
RUN apk del apk-tools && \ | ||
find / -name apk -prune -exec rm -rf {} ";" | ||
Comment on lines
+13
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Combine these steps to reduce layers. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need to worry about these layers because the |
||
|
||
|
||
# remove extraneous folders | ||
RUN rm -rf media mnt opt run srv | ||
|
||
FROM scratch | ||
MAINTAINER The Prometheus Authors <[email protected]> | ||
|
||
COPY --from=alpine / / | ||
Comment on lines
+23
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is copying everything, so, doing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure what you're asking for here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think what @SuperQ is suggesting is instead of removing the unneeded things in the base image and then copying everything here, we should use explicitly only COPY here what we need. |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previous iterations were trying to not include musl-libc . In this iteration, I haven't remove it. If that is okay, then we can leave the default dynamic linked
busybox
.