mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-21 22:47:49 +00:00
Integrating http_proxy https_proxy environment variables into docker build and final docker image
This commit is contained in:
parent
422a60c2ec
commit
87e043510c
23
Makefile
23
Makefile
@ -1,3 +1,11 @@
|
|||||||
|
ifdef http_proxy
|
||||||
|
DOCKER_HTTP_PROXY=--build-arg http_proxy=$(http_proxy)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef https_proxy
|
||||||
|
DOCKER_HTTPS_PROXY=--build-arg https_proxy=$(https_proxy)
|
||||||
|
endif
|
||||||
|
|
||||||
DISABLE_CACHE = 'false'
|
DISABLE_CACHE = 'false'
|
||||||
|
|
||||||
ARCH = rpi# rpi/amd64/i386/armv7hf/armel
|
ARCH = rpi# rpi/amd64/i386/armv7hf/armel
|
||||||
@ -15,7 +23,6 @@ PUBNUB_PUBLISH_KEY = pub-c-bananas
|
|||||||
MIXPANEL_TOKEN = bananasbananas
|
MIXPANEL_TOKEN = bananasbananas
|
||||||
|
|
||||||
PASSWORDLESS_DROPBEAR = false
|
PASSWORDLESS_DROPBEAR = false
|
||||||
|
|
||||||
ifdef BASE_DISTRO
|
ifdef BASE_DISTRO
|
||||||
$(info BASE_DISTRO SPECIFIED. START BUILDING ALPINE SUPERVISOR)
|
$(info BASE_DISTRO SPECIFIED. START BUILDING ALPINE SUPERVISOR)
|
||||||
IMAGE = "resin/$(ARCH)-supervisor:$(SUPERVISOR_VERSION)-alpine"
|
IMAGE = "resin/$(ARCH)-supervisor:$(SUPERVISOR_VERSION)-alpine"
|
||||||
@ -58,7 +65,7 @@ clean:
|
|||||||
|
|
||||||
supervisor-dind:
|
supervisor-dind:
|
||||||
sed -i 's/\(ENV PASSWORDLESS_DROPBEAR\).*/\1 ${PASSWORDLESS_DROPBEAR}/' tools/dind/Dockerfile
|
sed -i 's/\(ENV PASSWORDLESS_DROPBEAR\).*/\1 ${PASSWORDLESS_DROPBEAR}/' tools/dind/Dockerfile
|
||||||
cd tools/dind && docker build --no-cache=$(DISABLE_CACHE) -t resin/resin-supervisor-dind:$(SUPERVISOR_VERSION) .
|
cd tools/dind && docker build $(DOCKER_HTTP_PROXY) $(DOCKER_HTTPS_PROXY) --no-cache=$(DISABLE_CACHE) -t resin/resin-supervisor-dind:$(SUPERVISOR_VERSION) .
|
||||||
|
|
||||||
run-supervisor: supervisor-dind stop-supervisor
|
run-supervisor: supervisor-dind stop-supervisor
|
||||||
cd tools/dind \
|
cd tools/dind \
|
||||||
@ -78,7 +85,15 @@ supervisor: gosuper
|
|||||||
echo "ENV DEFAULT_PUBNUB_PUBLISH_KEY $(PUBNUB_PUBLISH_KEY)" >> Dockerfile
|
echo "ENV DEFAULT_PUBNUB_PUBLISH_KEY $(PUBNUB_PUBLISH_KEY)" >> Dockerfile
|
||||||
echo "ENV DEFAULT_PUBNUB_SUBSCRIBE_KEY $(PUBNUB_SUBSCRIBE_KEY)" >> Dockerfile
|
echo "ENV DEFAULT_PUBNUB_SUBSCRIBE_KEY $(PUBNUB_SUBSCRIBE_KEY)" >> Dockerfile
|
||||||
echo "ENV DEFAULT_MIXPANEL_TOKEN $(MIXPANEL_TOKEN)" >> Dockerfile
|
echo "ENV DEFAULT_MIXPANEL_TOKEN $(MIXPANEL_TOKEN)" >> Dockerfile
|
||||||
docker build --no-cache=$(DISABLE_CACHE) -t $(IMAGE) .
|
ifdef https_proxy
|
||||||
|
echo "ENV HTTPS_PROXY $(https_proxy)" >> Dockerfile
|
||||||
|
echo "ENV https_proxy $(https_proxy)" >> Dockerfile
|
||||||
|
endif
|
||||||
|
ifdef http_proxy
|
||||||
|
echo "ENV HTTP_PROXY $(http_proxy)" >> Dockerfile
|
||||||
|
echo "ENV http_proxy $(http_proxy)" >> Dockerfile
|
||||||
|
endif
|
||||||
|
docker build $(DOCKER_HTTP_PROXY) $(DOCKER_HTTPS_PROXY) --no-cache=$(DISABLE_CACHE) -t $(IMAGE) .
|
||||||
-rm Dockerfile
|
-rm Dockerfile
|
||||||
|
|
||||||
deploy: supervisor
|
deploy: supervisor
|
||||||
@ -87,7 +102,7 @@ deploy: supervisor
|
|||||||
|
|
||||||
go-builder:
|
go-builder:
|
||||||
-cp tools/dind/config.json ./gosuper/
|
-cp tools/dind/config.json ./gosuper/
|
||||||
cd gosuper && docker build -t resin/go-supervisor-builder:$(SUPERVISOR_VERSION) .
|
cd gosuper && docker build $(DOCKER_HTTP_PROXY) $(DOCKER_HTTPS_PROXY) -t resin/go-supervisor-builder:$(SUPERVISOR_VERSION) .
|
||||||
-rm ./gosuper/config.json
|
-rm ./gosuper/config.json
|
||||||
|
|
||||||
gosuper: go-builder
|
gosuper: go-builder
|
||||||
|
Loading…
Reference in New Issue
Block a user