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

Make intermediate images share more common layers #5960

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

tnqn
Copy link
Member

@tnqn tnqn commented Feb 4, 2024

By sharing more common layers, the total time can be reduced about 15s.

jainpulkit22
jainpulkit22 previously approved these changes Feb 5, 2024
Copy link
Contributor

@jainpulkit22 jainpulkit22 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

antoninbas
antoninbas previously approved these changes Feb 5, 2024
Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

LGTM

# Disable CGO for antctl in case it is copied outside of the container image. It
# also reduces the size of the binary and aligns with how we distribute antctl
# in release assets.
RUN --mount=type=cache,target=/go/pkg/mod/ \
--mount=type=cache,target=/root/.cache/go-build/ \
CGO_ENABLED=0 make antctl-linux && mv bin/antctl-linux bin/antctl

RUN --mount=type=cache,target=/go/pkg/mod/ \
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: a comment would be nice to explain that we build antrea-agent and antrea-cni first in order to share an extra layer with build/images/Dockerfile.build.agent.ubuntu

Copy link
Member Author

Choose a reason for hiding this comment

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

done, also made same changes to coverage and ubi images.

By sharing more common layers, the total time can be reduced about 15s.

Signed-off-by: Quan Tian <[email protected]>
@antoninbas
Copy link
Contributor

/test-all

@antoninbas antoninbas merged commit 18bf0d8 into antrea-io:main Feb 6, 2024
51 of 54 checks passed
@tnqn tnqn deleted the improve-build branch February 7, 2024 03:49
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.

3 participants