Add make install task

This installs docker and dockerd to `$DOCKER_MAKE_INSTALL_PREFIX/bin`, which
defaults to `/usr/local/bin`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 9bb54f89ad26015c79dab7c5ac210cb846e0713b
Component: engine
This commit is contained in:
Brian Goff
2016-05-23 21:44:43 -04:00
committed by Sebastiaan van Stijn
parent 37a5f59dad
commit 56f0d7968e
11 changed files with 79 additions and 14 deletions

View File

@ -0,0 +1,4 @@
#!/bin/bash
DOCKER_CLIENT_BINARY_NAME='docker'
DOCKER_DAEMON_BINARY_NAME='dockerd'

View File

@ -1,5 +1,6 @@
#!/bin/bash
set -e
rm -rf "$DEST"
# This script exists as backwards compatibility for CI
(

View File

@ -1,8 +1,12 @@
#!/bin/bash
set -e
[ -z "$KEEPDEST" ] && \
rm -rf "$DEST"
(
export BINARY_SHORT_NAME='docker'
source "${MAKEDIR}/.binary-setup"
export BINARY_SHORT_NAME="$DOCKER_CLIENT_BINARY_NAME"
export SOURCE_PATH='./cmd/docker'
source "${MAKEDIR}/.binary"
)

View File

@ -1,9 +1,13 @@
#!/bin/bash
set -e
[ -z "$KEEPDEST" ] && \
rm -rf "$DEST"
(
export BINARY_SHORT_NAME='dockerd'
source "${MAKEDIR}/.binary-setup"
export BINARY_SHORT_NAME="$DOCKER_DAEMON_BINARY_NAME"
export SOURCE_PATH='./cmd/dockerd'
source "${MAKEDIR}/.binary"
copy_containerd "$DEST" 'hash'
)
)

View File

@ -21,6 +21,7 @@ fi
for platform in $DOCKER_CROSSPLATFORMS; do
(
export KEEPDEST=1
export DEST="$DEST/$platform" # bundles/VERSION/cross/GOOS/GOARCH/docker-VERSION
mkdir -p "$DEST"
ABS_DEST="$(cd "$DEST" && pwd -P)"
@ -28,14 +29,14 @@ for platform in $DOCKER_CROSSPLATFORMS; do
export GOARCH=${platform##*/}
if [ -z "${daemonSupporting[$platform]}" ]; then
# we just need a simple client for these platforms
# we just need a simple client for these platforms
export LDFLAGS_STATIC_DOCKER=""
# remove the "daemon" build tag from platforms that aren't supported
export BUILDFLAGS=( "${ORIG_BUILDFLAGS[@]/ daemon/}" )
source "${MAKEDIR}/binary-client"
else
source "${MAKEDIR}/binary-client"
source "${MAKEDIR}/binary-daemon"
# remove the "daemon" build tag from platforms that aren't supported
export BUILDFLAGS=( "${ORIG_BUILDFLAGS[@]/ daemon/}" )
source "${MAKEDIR}/binary-client"
else
source "${MAKEDIR}/binary-client"
source "${MAKEDIR}/binary-daemon"
fi
)
done

View File

@ -0,0 +1,12 @@
#!/bin/bash
set -e
rm -rf "$DEST"
(
source "${MAKEDIR}/install-binary-client"
)
(
source "${MAKEDIR}/install-binary-daemon"
)

View File

@ -0,0 +1,10 @@
#!/bin/bash
set -e
rm -rf "$DEST"
(
DEST="$(dirname $DEST)/binary-client"
source "${MAKEDIR}/.binary-setup"
install_binary "${DEST}/${DOCKER_CLIENT_BINARY_NAME}"
)

View File

@ -0,0 +1,10 @@
#!/bin/bash
set -e
rm -rf "$DEST"
(
DEST="$(dirname $DEST)/binary-daemon"
source "${MAKEDIR}/.binary-setup"
install_binary "${DEST}/${DOCKER_DAEMON_BINARY_NAME}"
)

View File

@ -13,8 +13,11 @@ fi
for d in "$CROSS/"*/*; do
export GOARCH="$(basename "$d")"
export GOOS="$(basename "$(dirname "$d")")"
BINARY_NAME="docker-$VERSION"
DAEMON_BINARY_NAME="dockerd-$VERSION"
source "${MAKEDIR}/.binary-setup"
BINARY_NAME="${DOCKER_CLIENT_BINARY_NAME}-$VERSION"
DAEMON_BINARY_NAME="${DOCKER_DAEMON_BINARY_NAME}-$VERSION"
BINARY_EXTENSION="$(export GOOS && binary_extension)"
if [ "$GOOS" = 'windows' ]; then
# if windows use a zip, not tgz
@ -40,9 +43,9 @@ for d in "$CROSS/"*/*; do
# Copy the correct docker binary
mkdir -p $TAR_PATH
cp -L "$d/$BINARY_FULLNAME" "$TAR_PATH/docker$BINARY_EXTENSION"
cp -L "$d/$BINARY_FULLNAME" "$TAR_PATH/${DOCKER_CLIENT_BINARY_NAME}${BINARY_EXTENSION}"
if [ -f "$d/$DAEMON_BINARY_FULLNAME" ]; then
cp -L "$d/$DAEMON_BINARY_FULLNAME" "$TAR_PATH/dockerd$BINARY_EXTENSION"
cp -L "$d/$DAEMON_BINARY_FULLNAME" "$TAR_PATH/${DOCKER_DAEMON_BINARY_NAME}${BINARY_EXTENSION}"
fi
# copy over all the containerd binaries