Pass GOPROXY to image build from environment and job

Change-Id: I9f9ce1853aeee0f832c458587fdc8fb9de5566ed
Signed-off-by: Andrii Ostapenko <andrii.ostapenko@att.com>
This commit is contained in:
Andrii Ostapenko 2021-05-12 15:49:46 -05:00
parent ebfca69643
commit 64b5401aa2
No known key found for this signature in database
GPG Key ID: F3E83668DBB223B3
9 changed files with 13 additions and 0 deletions

View File

@ -4,6 +4,8 @@ FROM ${GO_IMAGE} as builder
ENV PATH "/usr/local/go/bin:$PATH"
ARG GOPROXY=""
# Inject custom root certificate authorities if needed
# Docker does not have a good conditional copy statement and requires that a source file exists
# to complete the copy function without error. Therefore the README.md file will be copied to

View File

@ -46,6 +46,9 @@ endif
ifneq ($(strip $(DOCKER_IMAGE_ENTRYPOINT)),)
DOCKER_CMD_FLAGS += --build-arg ENTRYPOINT=$(strip $(DOCKER_IMAGE_ENTRYPOINT))
endif
ifneq ($(strip $(GOPROXY)),)
DOCKER_CMD_FLAGS += --build-arg GOPROXY=$(strip $(GOPROXY))
endif
# use this variable for image labels added in internal build process
COMMIT ?= $(shell git rev-parse HEAD)
LABEL ?= org.airshipit.build=community

View File

@ -1,6 +1,7 @@
ARG GO_IMAGE=gcr.io/gcp-runtimes/go1-builder:1.15
ARG PLUGINS_RELEASE_IMAGE=alpine:3.12.0
FROM ${GO_IMAGE} as builder
ARG GOPROXY=""
# Inject custom root certificate authorities if needed
# Docker does not have a good conditional copy statement and requires that a source file exists

View File

@ -2,6 +2,8 @@ ARG GO_IMAGE=gcr.io/gcp-runtimes/go1-builder:1.15
ARG PLUGINS_RELEASE_IMAGE=alpine:3.12.0
FROM ${GO_IMAGE} as function
ARG GOPROXY=""
# Inject custom root certificate authorities if needed
# Docker does not have a good conditional copy statement and requires that a source file exists
# to complete the copy function without error. Therefore the README.md file will be copied to

View File

@ -1,6 +1,7 @@
ARG GO_IMAGE=gcr.io/gcp-runtimes/go1-builder:1.15
ARG PLUGINS_RELEASE_IMAGE=alpine:3.12.0
FROM ${GO_IMAGE} as builder
ARG GOPROXY=""
# Inject custom root certificate authorities if needed
# Docker does not have a good conditional copy statement and requires that a source file exists

View File

@ -1,6 +1,7 @@
ARG GO_IMAGE=gcr.io/gcp-runtimes/go1-builder:1.15
ARG PLUGINS_RELEASE_IMAGE=alpine:3.12.0
FROM ${GO_IMAGE} as builder
ARG GOPROXY=""
# Inject custom root certificate authorities if needed
# Docker does not have a good conditional copy statement and requires that a source file exists

View File

@ -2,6 +2,7 @@ ARG GO_IMAGE=gcr.io/gcp-runtimes/go1-builder:1.15
ARG PLUGINS_BUILD_IMAGE=alpine:3.12.0
ARG PLUGINS_RELEASE_IMAGE=alpine:3.12.0
FROM ${PLUGINS_BUILD_IMAGE} as ctls
ARG GOPROXY=""
RUN apk update && apk add curl
# Inject custom root certificate authorities if needed

View File

@ -18,6 +18,7 @@
PROXY: "{{ proxy.http }}"
NO_PROXY: "{{ proxy.noproxy }}"
USE_PROXY: "{{ proxy.enabled | lower }}"
GOPROXY: "{{ goproxy | default(omit) }}"
DOCKER_REGISTRY: "{{ image_repo }}"
DOCKER_IMAGE_TAG: "{{ zuul.change }}"
DOCKER_IMAGE_PREFIX: "{{ image_prefix }}"

View File

@ -37,6 +37,7 @@
PROXY: "{{ proxy.http }}"
NO_PROXY: "{{ proxy.noproxy }}"
USE_PROXY: "{{ proxy.enabled | lower }}"
GOPROXY: "{{ goproxy | default(omit) }}"
DOCKER_REGISTRY: "{{ image_repo }}"
DOCKER_IMAGE_PREFIX: "{{ image_prefix }}"
DOCKER_BASE_GO_IMAGE: "{{ docker.base_go_image | default(omit) }}"