diff --git a/Makefile b/Makefile index 89bc555..a7ee40d 100644 --- a/Makefile +++ b/Makefile @@ -98,6 +98,8 @@ bin/$(OS)_$(ARCH)/$(BIN): build-dirs -v $$(pwd)/bin/$(OS)_$(ARCH):/go/bin/$(OS)_$(ARCH) \ -v $$(pwd)/.go/std/$(OS)_$(ARCH):/usr/local/go/pkg/$(OS)_$(ARCH)_static \ -v $$(pwd)/.go/cache:/.cache \ + --env HTTP_PROXY=$(HTTP_PROXY) \ + --env HTTPS_PROXY=$(HTTPS_PROXY) \ -w /go/src/$(PKG) \ --rm \ $(BUILD_IMAGE) \ @@ -119,7 +121,12 @@ container: .container-$(DOTFILE_IMAGE) container-name -e 's|{ARG_OS}|$(OS)|g' \ -e 's|{ARG_FROM}|$(BASEIMAGE)|g' \ Dockerfile.in > .dockerfile-$(OS)_$(ARCH) - @docker build -t $(IMAGE):$(TAG) -f .dockerfile-$(OS)_$(ARCH) . + @docker build \ + --build-arg HTTP_PROXY=$(HTTP_PROXY) \ + --build-arg HTTPS_PROXY=$(HTTPS_PROXY) \ + -t $(IMAGE):$(TAG) \ + -f .dockerfile-$(OS)_$(ARCH) \ + . @docker images -q $(IMAGE):$(TAG) > $@ container-name: @@ -155,6 +162,8 @@ test: build-dirs -v $$(pwd)/bin/$(OS)_$(ARCH):/go/bin \ -v $$(pwd)/.go/std/$(OS)_$(ARCH):/usr/local/go/pkg/$(OS)_$(ARCH)_static \ -v $$(pwd)/.go/cache:/.cache \ + --env HTTP_PROXY=$(HTTP_PROXY) \ + --env HTTPS_PROXY=$(HTTPS_PROXY) \ -w /go/src/$(PKG) \ $(BUILD_IMAGE) \ /bin/sh -c " \ diff --git a/README.md b/README.md index fd50f87..26cf902 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,9 @@ git-sync can also be configured to make webhook call upon sucessful git repo syn # build the container make container REGISTRY=registry VERSION=tag +# build the container behind a proxy +make container REGISTRY=registry VERSION=tag HTTP_PROXY=http://: HTTPS_PROXY=https://: + # run the container docker run -d \ -v /tmp/git-data:/tmp/git \