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

Makefile: scripts: Add build args for proxy when using docker build #385

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

GabyCT
Copy link
Contributor

@GabyCT GabyCT commented Jun 11, 2024

This PR adds build args for proxy when using docker build, this is specially needed when we are behind a proxy to avoid failures.

Copy link
Member

@fidencio fidencio 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 @GabyCT!

Copy link
Member

@stevenhorsman stevenhorsman left a comment

Choose a reason for hiding this comment

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

The code LGTM, but one question about where the http_proxy and https_proxy values are set - is the expectation that these environment variables are set on the self-hosted runner independently of the operator workflow?

It looks like we get unbound variable errors when http_proxy isn't set, so I guess we need to make that behaviour safe too.

@GabyCT GabyCT force-pushed the topic/fixdockerarg branch from c8d6fac to 50a84cf Compare June 11, 2024 16:27
@GabyCT
Copy link
Contributor Author

GabyCT commented Jun 11, 2024

@stevenhorsman changes applied

@@ -143,9 +146,9 @@ run: manifests generate fmt vet ## Run a controller from your host.
docker-build: test ## Build docker image with the manager.
ifneq (, $(PEERPODS))
@echo PEERPODS is enabled
docker build -t ${IMG} -f Dockerfile.peerpods .
docker build --build-arg http_proxy=$(http_proxy) --build-arg https_proxy=$(https_proxy) -t ${IMG} -f Dockerfile.peerpods .
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a reason why this approach was chosen over the better alternative which just setting the ~/.docker/config.json?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mythi I have the proxies at the config but seems that when building the dockerfile is still failing without those arguments

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't prefer this approach. It'd be good to understand why the best option does not work

@GabyCT GabyCT force-pushed the topic/fixdockerarg branch 2 times, most recently from 550c956 to dec86b7 Compare June 12, 2024 17:42
This PR adds build args for proxy when using docker build, this is
specially needed when we are behind a proxy to avoid failures.

Signed-off-by: Gabriela Cervantes <[email protected]>
@GabyCT
Copy link
Contributor Author

GabyCT commented Jun 12, 2024

@stevenhorsman now the CI for tdx is passing

Copy link
Member

@stevenhorsman stevenhorsman left a comment

Choose a reason for hiding this comment

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

Thanks @GabyCT

@fidencio fidencio merged commit 5117129 into confidential-containers:main Jun 12, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants