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:
parent
ebfca69643
commit
64b5401aa2
@ -4,6 +4,8 @@ FROM ${GO_IMAGE} as builder
|
|||||||
|
|
||||||
ENV PATH "/usr/local/go/bin:$PATH"
|
ENV PATH "/usr/local/go/bin:$PATH"
|
||||||
|
|
||||||
|
ARG GOPROXY=""
|
||||||
|
|
||||||
# Inject custom root certificate authorities if needed
|
# Inject custom root certificate authorities if needed
|
||||||
# Docker does not have a good conditional copy statement and requires that a source file exists
|
# 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
|
# to complete the copy function without error. Therefore the README.md file will be copied to
|
||||||
|
3
Makefile
3
Makefile
@ -46,6 +46,9 @@ endif
|
|||||||
ifneq ($(strip $(DOCKER_IMAGE_ENTRYPOINT)),)
|
ifneq ($(strip $(DOCKER_IMAGE_ENTRYPOINT)),)
|
||||||
DOCKER_CMD_FLAGS += --build-arg ENTRYPOINT=$(strip $(DOCKER_IMAGE_ENTRYPOINT))
|
DOCKER_CMD_FLAGS += --build-arg ENTRYPOINT=$(strip $(DOCKER_IMAGE_ENTRYPOINT))
|
||||||
endif
|
endif
|
||||||
|
ifneq ($(strip $(GOPROXY)),)
|
||||||
|
DOCKER_CMD_FLAGS += --build-arg GOPROXY=$(strip $(GOPROXY))
|
||||||
|
endif
|
||||||
# use this variable for image labels added in internal build process
|
# use this variable for image labels added in internal build process
|
||||||
COMMIT ?= $(shell git rev-parse HEAD)
|
COMMIT ?= $(shell git rev-parse HEAD)
|
||||||
LABEL ?= org.airshipit.build=community
|
LABEL ?= org.airshipit.build=community
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
ARG GO_IMAGE=gcr.io/gcp-runtimes/go1-builder:1.15
|
ARG GO_IMAGE=gcr.io/gcp-runtimes/go1-builder:1.15
|
||||||
ARG PLUGINS_RELEASE_IMAGE=alpine:3.12.0
|
ARG PLUGINS_RELEASE_IMAGE=alpine:3.12.0
|
||||||
FROM ${GO_IMAGE} as builder
|
FROM ${GO_IMAGE} as builder
|
||||||
|
ARG GOPROXY=""
|
||||||
|
|
||||||
# Inject custom root certificate authorities if needed
|
# Inject custom root certificate authorities if needed
|
||||||
# Docker does not have a good conditional copy statement and requires that a source file exists
|
# Docker does not have a good conditional copy statement and requires that a source file exists
|
||||||
|
@ -2,6 +2,8 @@ ARG GO_IMAGE=gcr.io/gcp-runtimes/go1-builder:1.15
|
|||||||
ARG PLUGINS_RELEASE_IMAGE=alpine:3.12.0
|
ARG PLUGINS_RELEASE_IMAGE=alpine:3.12.0
|
||||||
|
|
||||||
FROM ${GO_IMAGE} as function
|
FROM ${GO_IMAGE} as function
|
||||||
|
ARG GOPROXY=""
|
||||||
|
|
||||||
# Inject custom root certificate authorities if needed
|
# Inject custom root certificate authorities if needed
|
||||||
# Docker does not have a good conditional copy statement and requires that a source file exists
|
# 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
|
# to complete the copy function without error. Therefore the README.md file will be copied to
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
ARG GO_IMAGE=gcr.io/gcp-runtimes/go1-builder:1.15
|
ARG GO_IMAGE=gcr.io/gcp-runtimes/go1-builder:1.15
|
||||||
ARG PLUGINS_RELEASE_IMAGE=alpine:3.12.0
|
ARG PLUGINS_RELEASE_IMAGE=alpine:3.12.0
|
||||||
FROM ${GO_IMAGE} as builder
|
FROM ${GO_IMAGE} as builder
|
||||||
|
ARG GOPROXY=""
|
||||||
|
|
||||||
# Inject custom root certificate authorities if needed
|
# Inject custom root certificate authorities if needed
|
||||||
# Docker does not have a good conditional copy statement and requires that a source file exists
|
# Docker does not have a good conditional copy statement and requires that a source file exists
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
ARG GO_IMAGE=gcr.io/gcp-runtimes/go1-builder:1.15
|
ARG GO_IMAGE=gcr.io/gcp-runtimes/go1-builder:1.15
|
||||||
ARG PLUGINS_RELEASE_IMAGE=alpine:3.12.0
|
ARG PLUGINS_RELEASE_IMAGE=alpine:3.12.0
|
||||||
FROM ${GO_IMAGE} as builder
|
FROM ${GO_IMAGE} as builder
|
||||||
|
ARG GOPROXY=""
|
||||||
|
|
||||||
# Inject custom root certificate authorities if needed
|
# Inject custom root certificate authorities if needed
|
||||||
# Docker does not have a good conditional copy statement and requires that a source file exists
|
# Docker does not have a good conditional copy statement and requires that a source file exists
|
||||||
|
@ -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_BUILD_IMAGE=alpine:3.12.0
|
||||||
ARG PLUGINS_RELEASE_IMAGE=alpine:3.12.0
|
ARG PLUGINS_RELEASE_IMAGE=alpine:3.12.0
|
||||||
FROM ${PLUGINS_BUILD_IMAGE} as ctls
|
FROM ${PLUGINS_BUILD_IMAGE} as ctls
|
||||||
|
ARG GOPROXY=""
|
||||||
|
|
||||||
RUN apk update && apk add curl
|
RUN apk update && apk add curl
|
||||||
# Inject custom root certificate authorities if needed
|
# Inject custom root certificate authorities if needed
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
PROXY: "{{ proxy.http }}"
|
PROXY: "{{ proxy.http }}"
|
||||||
NO_PROXY: "{{ proxy.noproxy }}"
|
NO_PROXY: "{{ proxy.noproxy }}"
|
||||||
USE_PROXY: "{{ proxy.enabled | lower }}"
|
USE_PROXY: "{{ proxy.enabled | lower }}"
|
||||||
|
GOPROXY: "{{ goproxy | default(omit) }}"
|
||||||
DOCKER_REGISTRY: "{{ image_repo }}"
|
DOCKER_REGISTRY: "{{ image_repo }}"
|
||||||
DOCKER_IMAGE_TAG: "{{ zuul.change }}"
|
DOCKER_IMAGE_TAG: "{{ zuul.change }}"
|
||||||
DOCKER_IMAGE_PREFIX: "{{ image_prefix }}"
|
DOCKER_IMAGE_PREFIX: "{{ image_prefix }}"
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
PROXY: "{{ proxy.http }}"
|
PROXY: "{{ proxy.http }}"
|
||||||
NO_PROXY: "{{ proxy.noproxy }}"
|
NO_PROXY: "{{ proxy.noproxy }}"
|
||||||
USE_PROXY: "{{ proxy.enabled | lower }}"
|
USE_PROXY: "{{ proxy.enabled | lower }}"
|
||||||
|
GOPROXY: "{{ goproxy | default(omit) }}"
|
||||||
DOCKER_REGISTRY: "{{ image_repo }}"
|
DOCKER_REGISTRY: "{{ image_repo }}"
|
||||||
DOCKER_IMAGE_PREFIX: "{{ image_prefix }}"
|
DOCKER_IMAGE_PREFIX: "{{ image_prefix }}"
|
||||||
DOCKER_BASE_GO_IMAGE: "{{ docker.base_go_image | default(omit) }}"
|
DOCKER_BASE_GO_IMAGE: "{{ docker.base_go_image | default(omit) }}"
|
||||||
|
Loading…
Reference in New Issue
Block a user