Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Fix docker cache invalidation due to missing build argument #4462

Merged
merged 1 commit into from
Mar 9, 2023

Conversation

sathyanarays
Copy link
Contributor

@sathyanarays sathyanarays commented Mar 8, 2023

What this PR does / why we need it

The build-tooling.mk has test target defined as follows:

test: fmt vet
	$(DOCKER) build . -f Dockerfile --target test --build-arg COMPONENT=$(COMPONENT) --build-arg GOPROXY_ARG=$(GOPROXY)
	@$(DOCKER) build . -f Dockerfile --target unit-test-coverage --build-arg COMPONENT=$(COMPONENT) --output build/$(COMPONENT)/coverage

In the second docker build, the build argument is not passed for configuring the go proxy. This argument is passed in all other relevant docker builds. As a result, the docker cache got computed again and added some time to the overall build.

With this fix, the cache does not get re-computed.

Which issue(s) this PR fixes

Fixes #4465

Describe testing done for PR

Testing is done locally by clearing the docker cache and ensuring the go mod cache is populated only once for each component.

Release note


Additional information

Special notes for your reviewer

Signed-off-by: Sathyanarayanan Saravanamuthu <sathyanarays@vmware.com>
Copy link
Member

@yharish991 yharish991 left a comment

Choose a reason for hiding this comment

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

LGTM!! Can you attach an issue to this pr and also add testing done? thanks

@sathyanarays sathyanarays merged commit 8ca88dd into feature/runtime-core Mar 9, 2023
@sathyanarays sathyanarays deleted the sathyanarays/docker_build_fix branch March 9, 2023 03:50
avi-08 pushed a commit to avi-08/tanzu-framework that referenced this pull request Mar 10, 2023
…anzu#4462)

Signed-off-by: Sathyanarayanan Saravanamuthu <sathyanarays@vmware.com>
rajathagasthya pushed a commit to rajathagasthya/tanzu-framework that referenced this pull request Apr 26, 2023
…anzu#4462)

Signed-off-by: Sathyanarayanan Saravanamuthu <sathyanarays@vmware.com>
rajathagasthya pushed a commit that referenced this pull request Apr 29, 2023
Signed-off-by: Sathyanarayanan Saravanamuthu <sathyanarays@vmware.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants