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

Trims the buildbox #14036

Merged
merged 11 commits into from
Jul 7, 2022
Merged

Trims the buildbox #14036

merged 11 commits into from
Jul 7, 2022

Conversation

tcsc
Copy link
Contributor

@tcsc tcsc commented Jul 1, 2022

Enables the docker BuildKit in an attempt to speed up builds, and trims just under 2GB off the image size.

Prior to these changes, docker image ls reported the image as 6.08GB after a local build, and 5.06GB 4.17GB after

See-Also: #6149

tcsc added 2 commits July 1, 2022 17:07
 - Enables the docker BuildKit in an attempt to speed up builds
 - Trims ~1GB off image size
@tcsc tcsc marked this pull request as ready for review July 1, 2022 07:10
@tcsc tcsc requested a review from zmb3 July 1, 2022 07:16
Copy link
Collaborator

@zmb3 zmb3 left a comment

Choose a reason for hiding this comment

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

LGTM with Gus's suggestions addressed.

@zmb3
Copy link
Collaborator

zmb3 commented Jul 1, 2022

@tcsc could you include Dockerfile-centos7 in scope for this as well?

Copy link
Collaborator

@r0mant r0mant left a comment

Choose a reason for hiding this comment

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

Yep, we need to do this for Centos 7 dockerfile and makefile command also. We're going to use Centos 7 for all amd64 artifacts for Teleport 10.

tcsc added 4 commits July 4, 2022 15:19
 - Break more dependencies out into separate build stages
 - Add some simple supply-chain protections for dependencies sourced
   via git. The Docker build now checks that the commit SHAs are what
   we expect, and not just assume that the tags haven't changed.
 - Moves the `cbindgen` build to a stage to avoid pulling in extra
   dependencies not needed for the Teleport build
 - Combines the `gcloud` and firestore emulator install into one step to
   reduce the layer count.
 - Ports some of the above the Centos7 Dockerfile.
@tcsc tcsc requested review from zmb3, webvictim and r0mant July 4, 2022 05:41
@@ -121,7 +121,7 @@ build-binaries-fips: buildbox-fips
buildbox:
if [[ "$(BUILDBOX_NAME)" == "$(BUILDBOX)" ]]; then \
if [[ $${DRONE} == "true" ]] && ! docker inspect --type=image $(BUILDBOX) 2>&1 >/dev/null; then docker pull $(BUILDBOX) || true; fi; \
docker build --platform=linux/$(RUNTIME_ARCH) \
DOCKER_BUILDKIT=1 docker build --platform=linux/$(RUNTIME_ARCH) \
Copy link
Contributor

Choose a reason for hiding this comment

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

There’s also a leading space here; doesn’t make any difference to the way it runs, just can’t unsee it 😁

@tcsc tcsc merged commit e3ced07 into master Jul 7, 2022
@tcsc tcsc deleted the tcsc/trim-buildbox-buildkit branch July 7, 2022 02:38
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.

5 participants