Ver código fonte

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 9 anos atrás
pai
commit
94fb7458ea
2 arquivos alterados com 7 adições e 8 exclusões
  1. 0 8
      Makefile
  2. 7 0
      hack/make/.integration-daemon-setup

+ 0 - 8
Makefile

@@ -2,11 +2,6 @@
 
 # get OS/Arch of docker engine
 DOCKER_ENGINE_OSARCH = $(shell docker version | grep 'OS/Arch' | tail -1 | cut -d':' -f2 | tr -d '[[:space:]]')
-DOCKER_ENGINE_GOOS = $(word 1, $(subst /, ,$(DOCKER_ENGINE_OSARCH)))
-DOCKER_ENGINE_GOARCH = $(word 2, $(subst /, ,$(DOCKER_ENGINE_OSARCH)))
-export DOCKER_ENGINE_OSARCH
-export DOCKER_ENGINE_GOOS
-export DOCKER_ENGINE_GOARCH
 # default for linux/amd64 and others
 DOCKER_FILE = Dockerfile
 # switch to different Dockerfile for linux/arm
@@ -22,9 +17,6 @@ DOCKER_ENVS := \
 	-e BUILDFLAGS \
 	-e DOCKER_CLIENTONLY \
 	-e DOCKER_DEBUG \
-	-e DOCKER_ENGINE_GOARCH \
-	-e DOCKER_ENGINE_GOOS \
-	-e DOCKER_ENGINE_OSARCH \
 	-e DOCKER_EXPERIMENTAL \
 	-e DOCKER_FILE \
 	-e DOCKER_GRAPHDRIVER \

+ 7 - 0
hack/make/.integration-daemon-setup

@@ -1,5 +1,12 @@
 #!/bin/bash
 
+# Retrieve OS/ARCH of docker daemon, eg. linux/amd64
+export DOCKER_ENGINE_OSARCH=$(docker version | grep 'OS/Arch' | tail -1 | cut -d':' -f2 | tr -d '[[:space:]]')
+# Retrieve OS of docker daemon, eg. linux
+export DOCKER_ENGINE_GOOS=$(echo $DOCKER_ENGINE_OSARCH | cut -d'/' -f1)
+# Retrieve ARCH of docker daemon, eg. amd64
+export DOCKER_ENGINE_GOARCH=$(echo $DOCKER_ENGINE_OSARCH | cut -d'/' -f2)
+
 bundle .ensure-emptyfs
 bundle .ensure-frozen-images
 bundle .ensure-httpserver