1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/hack/make/.detect-daemon-osarch
Tianon Gravi 91201678c6 Refactor multi-arch support (especially for new mostly-official multi-arch official images)
See 99433d2ca2/README.md (architectures-other-than-amd64) for some context of where these images come from.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2016-01-06 14:34:29 -08:00

18 lines
596 B
Bash

#!/bin/bash
set -e
# Retrieve OS/ARCH of docker daemon, eg. linux/amd64
export DOCKER_ENGINE_OSARCH="$(docker version |tac|tac| awk '
$1 == "Client:" { server = 0; next }
$1 == "Server:" { server = 1; next }
server && $1 == "OS/Arch:" { print $2; exit }
')"
export DOCKER_ENGINE_GOOS="${DOCKER_ENGINE_OSARCH%/*}"
export DOCKER_ENGINE_GOARCH="${DOCKER_ENGINE_OSARCH##*/}"
# and the client, just in case
export DOCKER_CLIENT_OSARCH="$(docker version |tac|tac| awk '
$1 == "Client:" { client = 1; next }
$1 == "Server:" { client = 0; next }
client && $1 == "OS/Arch:" { print $2; exit }
')"