Skip to content

Commit

Permalink
Merge pull request moby#21625 from kencochrane/fix_tgz_directory
Browse files Browse the repository at this point in the history
Change the directory inside of tgz files.
  • Loading branch information
calavera committed Mar 30, 2016
2 parents 8dabc0c + 7df5b32 commit 8c06ba3
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions hack/make/tgz
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,29 @@ for d in "$CROSS/"*/*; do
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/"
# The staging directory for the files in the tgz
BUILD_PATH="$DEST/build"

tar --numeric-owner --owner 0 -C "$DEST/build" -czf "$TGZ" usr
# The directory that is at the root of the tar file
TAR_BASE_DIRECTORY="docker"

# $DEST/build/docker
TAR_PATH="$BUILD_PATH/$TAR_BASE_DIRECTORY"

# Copy the correct docker binary
mkdir -p $TAR_PATH
cp -L "$d/$BINARY_FULLNAME" "$TAR_PATH/docker$BINARY_EXTENSION"

# copy over all the containerd binaries
copy_containerd $TAR_PATH

echo "Creating tgz from $BUILD_PATH and naming it $TGZ"
tar --numeric-owner --owner 0 -C "$BUILD_PATH" -czf "$TGZ" $TAR_BASE_DIRECTORY

hash_files "$TGZ"

rm -rf "$DEST/build"
# cleanup after ourselves
rm -rf "$BUILD_PATH"

echo "Created tgz: $TGZ"
done
Expand Down

0 comments on commit 8c06ba3

Please sign in to comment.