Skip to content

Commit 5b59e06

Browse files
committed
[FAB-2829]-Build fails if Docker flags contain spaces
There are cases where the make script setting DOCKER_BUILD_FLAGS and DOCKER_RUN_FLAGS that are used to set DBUILD and DRUN variables generate values containing whitespace. https://jira.hyperledger.org/browse/FAB-2829 - Enclosed variables to prevent spaces breaking docker build and docker run commands. - Tested build on OSX (10.12.3), Debian 8.7 and Windows 10 Change-Id: Ie353c6561dc1abecc05201205ef46b43608af6ac Signed-off-by: Nick Murray <[email protected]>
1 parent 22c1a1f commit 5b59e06

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

docker-env.mk

+12-12
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,28 @@ endif
2323
endif
2424

2525
ifneq ($(http_proxy),)
26-
DOCKER_BUILD_FLAGS+=--build-arg http_proxy=$(http_proxy)
27-
DOCKER_RUN_FLAGS+=-e http_proxy=$(http_proxy)
26+
DOCKER_BUILD_FLAGS+=--build-arg 'http_proxy=$(http_proxy)'
27+
DOCKER_RUN_FLAGS+=-e 'http_proxy=$(http_proxy)'
2828
endif
2929
ifneq ($(https_proxy),)
30-
DOCKER_BUILD_FLAGS+=--build-arg https_proxy=$(https_proxy)
31-
DOCKER_RUN_FLAGS+=-e https_proxy=$(https_proxy)
30+
DOCKER_BUILD_FLAGS+=--build-arg 'https_proxy=$(https_proxy)'
31+
DOCKER_RUN_FLAGS+=-e 'https_proxy=$(https_proxy)'
3232
endif
3333
ifneq ($(HTTP_PROXY),)
34-
DOCKER_BUILD_FLAGS+=--build-arg HTTP_PROXY=$(HTTP_PROXY)
35-
DOCKER_RUN_FLAGS+=-e HTTP_PROXY=$(HTTP_PROXY)
34+
DOCKER_BUILD_FLAGS+=--build-arg 'HTTP_PROXY=$(HTTP_PROXY)'
35+
DOCKER_RUN_FLAGS+=-e 'HTTP_PROXY=$(HTTP_PROXY)'
3636
endif
3737
ifneq ($(HTTPS_PROXY),)
38-
DOCKER_BUILD_FLAGS+=--build-arg HTTPS_PROXY=$(HTTPS_PROXY)
39-
DOCKER_RUN_FLAGS+=-e HTTPS_PROXY=$(HTTPS_PROXY)
38+
DOCKER_BUILD_FLAGS+=--build-arg 'HTTPS_PROXY=$(HTTPS_PROXY)'
39+
DOCKER_RUN_FLAGS+=-e 'HTTPS_PROXY=$(HTTPS_PROXY)'
4040
endif
4141
ifneq ($(no_proxy),)
42-
DOCKER_BUILD_FLAGS+=--build-arg no_proxy=$(no_proxy)
43-
DOCKER_RUN_FLAGS+=-e no_proxy=$(no_proxy)
42+
DOCKER_BUILD_FLAGS+=--build-arg 'no_proxy=$(no_proxy)'
43+
DOCKER_RUN_FLAGS+=-e 'no_proxy=$(no_proxy)'
4444
endif
4545
ifneq ($(NO_PROXY),)
46-
DOCKER_BUILD_FLAGS+=--build-arg NO_PROXY=$(NO_PROXY)
47-
DOCKER_RUN_FLAGS+=-e NO_PROXY=$(NO_PROXY)
46+
DOCKER_BUILD_FLAGS+=--build-arg 'NO_PROXY=$(NO_PROXY)'
47+
DOCKER_RUN_FLAGS+=-e 'NO_PROXY=$(NO_PROXY)'
4848
endif
4949

5050
DRUN = docker run -i --rm $(DOCKER_RUN_FLAGS) \

0 commit comments

Comments
 (0)