-
Notifications
You must be signed in to change notification settings - Fork 806
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
Switch to Alpine 3.8 as base image #69
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bertinatto The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@leakingtapan, what do you think about this? I don't have any problems using any other base image, like Amazon Linux. However, Alpine seemed to be the lighter alternative. |
COPY --from=builder /go/src/github.com/kubernetes-sigs/aws-ebs-csi-driver/bin/aws-ebs-csi-driver /bin/aws-ebs-csi-driver | ||
RUN microdnf install -y e2fsprogs && microdnf clean all | ||
RUN apk add --no-cache ca-certificates e2fsprogs |
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.
Just realize one existing issue, could you switch RUN apk add...
with COPY
so that docker build doesn't generate new mid layer each time we make changes to driver?
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.
I'm not sure if I understand. We need to install e2fsprogs
and ca-certificates
, and the way to do that in Alpine is with pkg add
. Not sure if we can do that with COPY
.
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.
I mean switching the line order to be like:
RUN apk add --no-cache ca-certificates e2fsprogs
COPY --from=builder /go/src/github.com/kubernetes-sigs/aws-ebs-csi-driver/bin/aws-ebs-csi-driver /bin/aws-ebs-csi-driver
Because each line in docker file generates a new layer of docker image, we could avoid keep generating the apk add
layer if it is before COPY
line
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.
Gotcha... Done
e0a06fe
to
8adaf84
Compare
/lgtm |
Fixes #59.
Image size decreases considerably: