Browse code

Move DOCKER_ENGINE_ envs to integration-daemon-setup to allow build w/o Makefile

Signed-off-by: Stefan Scherer <scherer_stefan@icloud.com>

Stefan Scherer authored on 2015/12/18 02:55:45
Showing 2 changed files
... ...
@@ -2,11 +2,6 @@
2 2
 
3 3
 # get OS/Arch of docker engine
4 4
 DOCKER_ENGINE_OSARCH = $(shell docker version | grep 'OS/Arch' | tail -1 | cut -d':' -f2 | tr -d '[[:space:]]')
5
-DOCKER_ENGINE_GOOS = $(word 1, $(subst /, ,$(DOCKER_ENGINE_OSARCH)))
6
-DOCKER_ENGINE_GOARCH = $(word 2, $(subst /, ,$(DOCKER_ENGINE_OSARCH)))
7
-export DOCKER_ENGINE_OSARCH
8
-export DOCKER_ENGINE_GOOS
9
-export DOCKER_ENGINE_GOARCH
10 5
 # default for linux/amd64 and others
11 6
 DOCKER_FILE = Dockerfile
12 7
 # switch to different Dockerfile for linux/arm
... ...
@@ -22,9 +17,6 @@ DOCKER_ENVS := \
22 22
 	-e BUILDFLAGS \
23 23
 	-e DOCKER_CLIENTONLY \
24 24
 	-e DOCKER_DEBUG \
25
-	-e DOCKER_ENGINE_GOARCH \
26
-	-e DOCKER_ENGINE_GOOS \
27
-	-e DOCKER_ENGINE_OSARCH \
28 25
 	-e DOCKER_EXPERIMENTAL \
29 26
 	-e DOCKER_FILE \
30 27
 	-e DOCKER_GRAPHDRIVER \
... ...
@@ -1,5 +1,12 @@
1 1
 #!/bin/bash
2 2
 
3
+# Retrieve OS/ARCH of docker daemon, eg. linux/amd64
4
+export DOCKER_ENGINE_OSARCH=$(docker version | grep 'OS/Arch' | tail -1 | cut -d':' -f2 | tr -d '[[:space:]]')
5
+# Retrieve OS of docker daemon, eg. linux
6
+export DOCKER_ENGINE_GOOS=$(echo $DOCKER_ENGINE_OSARCH | cut -d'/' -f1)
7
+# Retrieve ARCH of docker daemon, eg. amd64
8
+export DOCKER_ENGINE_GOARCH=$(echo $DOCKER_ENGINE_OSARCH | cut -d'/' -f2)
9
+
3 10
 bundle .ensure-emptyfs
4 11
 bundle .ensure-frozen-images
5 12
 bundle .ensure-httpserver