moby/hack/make/tgz
Ken Cochrane bb66d7144f Packaging changes required for new containerd binaries
These are the changes required due to the new binaries that containerd introduced.
The rpm, and deb packages now include 5 binaries.

docker, containerd, containerd-shim, ctr, and runc

The tar files also include all 5 binaries.

Signed-off-by: Ken Cochrane <KenCochrane@gmail.com>
2016-03-24 16:25:33 -04:00

34 lines
780 B
Bash

#!/bin/bash
CROSS="$DEST/../cross"
set -e
if [ ! -d "$CROSS/linux/amd64" ]; then
echo >&2 'error: binary and cross must be run before tgz'
false
fi
(
for d in "$CROSS/"*/*; do
export GOARCH="$(basename "$d")"
export GOOS="$(basename "$(dirname "$d")")"
BINARY_NAME="docker-$VERSION"
BINARY_EXTENSION="$(export GOOS && binary_extension)"
BINARY_FULLNAME="$BINARY_NAME$BINARY_EXTENSION"
mkdir -p "$DEST/$GOOS/$GOARCH"
TGZ="$DEST/$GOOS/$GOARCH/$BINARY_NAME.tgz"
mkdir -p "$DEST/build/usr/local/bin"
cp -L "$d/$BINARY_FULLNAME" "$DEST/build/usr/local/bin/docker$BINARY_EXTENSION"
copy_containerd "$DEST/build/usr/local/bin/"
tar --numeric-owner --owner 0 -C "$DEST/build" -czf "$TGZ" usr
hash_files "$TGZ"
rm -rf "$DEST/build"
echo "Created tgz: $TGZ"
done
)