Skip to content

Commit

Permalink
Makefile: scripts: Add build args for proxy when using docker build
Browse files Browse the repository at this point in the history
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 <gabriela.cervantes.tellez@intel.com>
  • Loading branch information
GabyCT committed Jun 11, 2024
1 parent 15e862d commit c8d6fac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,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 .
else
docker build -t ${IMG} .
docker build --build-arg http_proxy=$(http_proxy) --build-arg https_proxy=$(https_proxy) -t ${IMG} .
endif

.PHONY: docker-push
Expand Down Expand Up @@ -270,7 +270,7 @@ bundle: manifests kustomize operator-sdk## Generate bundle manifests and metadat

.PHONY: bundle-build
bundle-build: ## Build the bundle image.
docker build -f bundle.Dockerfile -t $(BUNDLE_IMG) .
docker build --build-arg http_proxy=$(http_proxy) --build-arg https_proxy=$(https_proxy) -f bundle.Dockerfile -t $(BUNDLE_IMG) .

.PHONY: bundle-push
bundle-push: ## Push the bundle image.
Expand Down
2 changes: 2 additions & 0 deletions install/pre-install-payload/payload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ function build_payload() {

echo "Building containerd payload image for ${arch}"
docker buildx build \
--build-arg HTTP_PROXY="${http_proxy}" \
--build-arg HTTPS_PROXY="${https_proxy}" \
--build-arg ARCH="${golang_arch}" \
--build-arg COCO_CONTAINERD_VERSION="${coco_containerd_version}" \
--build-arg COCO_CONTAINERD_REPO="${coco_containerd_repo}" \
Expand Down

0 comments on commit c8d6fac

Please sign in to comment.