This will bail before deleting the binaries if it can't connect to a Docker host. Sometimes I build machine binaries when I haven't got a machine and then it removes the machine binaries and then I can't use machine to create a machine and then the universe implodes. :( Signed-off-by: Ben Firshman <ben@firshman.co.uk>
19 lines
436 B
Bash
Executable File
19 lines
436 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
if [ -z "$1" ]; then
|
|
OS_PLATFORM_ARG=(-os="darwin linux windows")
|
|
else
|
|
OS_PLATFORM_ARG=($1)
|
|
fi
|
|
|
|
if [ -z "$2" ]; then
|
|
OS_ARCH_ARG=(-arch="386 amd64")
|
|
else
|
|
OS_ARCH_ARG=($2)
|
|
fi
|
|
|
|
docker build -t docker-machine .
|
|
rm -f docker-machine*
|
|
exec docker run --rm -v `pwd`:/go/src/github.com/docker/machine docker-machine gox "${OS_PLATFORM_ARG[@]}" "${OS_ARCH_ARG[@]}" -output="docker-machine_{{.OS}}-{{.Arch}}"
|