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

Switch to Alpine 3.8 as base image #69

Merged
merged 1 commit into from
Oct 22, 2018

Conversation

bertinatto
Copy link
Member

Fixes #59.

Image size decreases considerably:

quay.io/bertinatto/ebs-csi-driver           testing            b73128d25c5d   2 minutes ago    30.2MB

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 17, 2018
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 17, 2018
@coveralls
Copy link

coveralls commented Oct 17, 2018

Pull Request Test Coverage Report for Build 70

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 49.058%

Totals Coverage Status
Change from base Build 69: 0.0%
Covered Lines: 521
Relevant Lines: 1062

💛 - Coveralls

@bertinatto bertinatto changed the title [WIP] Switch to Alpine 3.8 as base image Switch to Alpine 3.8 as base image Oct 19, 2018
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 19, 2018
@bertinatto
Copy link
Member Author

@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
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Gotcha... Done

@leakingtapan
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 22, 2018
@k8s-ci-robot k8s-ci-robot merged commit 3ccbea5 into kubernetes-sigs:master Oct 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants