mirror of https://github.com/docker/docs.git
Add several of the small make.sh fixes from #1920, and make the output more consistent and contributor-friendly, since release instructions already exist in release.sh
This commit is contained in:
parent
03fe5632d0
commit
aa3de0b849
30
hack/make.sh
30
hack/make.sh
|
@ -16,8 +16,8 @@
|
||||||
# DO NOT CALL THIS SCRIPT DIRECTLY.
|
# DO NOT CALL THIS SCRIPT DIRECTLY.
|
||||||
# - The right way to call this script is to invoke "docker build ." from
|
# - The right way to call this script is to invoke "docker build ." from
|
||||||
# your checkout of the Docker repository, and then
|
# your checkout of the Docker repository, and then
|
||||||
# "docker run hack/make.sh" in the resulting container image.
|
# "docker run hack/make.sh" in the resulting container image.
|
||||||
#
|
#
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
@ -25,9 +25,9 @@ set -e
|
||||||
# but really, they shouldn't. We want to be in a container!
|
# but really, they shouldn't. We want to be in a container!
|
||||||
RESOLVCONF=$(readlink --canonicalize /etc/resolv.conf)
|
RESOLVCONF=$(readlink --canonicalize /etc/resolv.conf)
|
||||||
grep -q "$RESOLVCONF" /proc/mounts || {
|
grep -q "$RESOLVCONF" /proc/mounts || {
|
||||||
echo "# WARNING! I don't seem to be running in a docker container.
|
echo "# WARNING! I don't seem to be running in a docker container."
|
||||||
echo "# The result of this command might be an incorrect build, and will not be officially supported."
|
echo "# The result of this command might be an incorrect build, and will not be officially supported."
|
||||||
echo "# Try this: 'docker build -t docker . && docker run docker ./hack/make.sh'
|
echo "# Try this: 'docker build -t docker . && docker run docker ./hack/make.sh'"
|
||||||
}
|
}
|
||||||
|
|
||||||
# List of bundles to create when no argument is passed
|
# List of bundles to create when no argument is passed
|
||||||
|
@ -39,8 +39,7 @@ DEFAULT_BUNDLES=(
|
||||||
|
|
||||||
VERSION=$(cat ./VERSION)
|
VERSION=$(cat ./VERSION)
|
||||||
GITCOMMIT=$(git rev-parse --short HEAD)
|
GITCOMMIT=$(git rev-parse --short HEAD)
|
||||||
if test -n "$(git status --porcelain)"
|
if [ -n "$(git status --porcelain)" ]; then
|
||||||
then
|
|
||||||
GITCOMMIT="$GITCOMMIT-dirty"
|
GITCOMMIT="$GITCOMMIT-dirty"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -51,19 +50,19 @@ LDFLAGS="-X main.GITCOMMIT $GITCOMMIT -X main.VERSION $VERSION -d -w"
|
||||||
bundle() {
|
bundle() {
|
||||||
bundlescript=$1
|
bundlescript=$1
|
||||||
bundle=$(basename $bundlescript)
|
bundle=$(basename $bundlescript)
|
||||||
echo "---> Making bundle: $bundle"
|
echo "---> Making bundle: $bundle (in bundles/$VERSION/$bundle)"
|
||||||
mkdir -p bundles/$VERSION/$bundle
|
mkdir -p bundles/$VERSION/$bundle
|
||||||
source $bundlescript $(pwd)/bundles/$VERSION/$bundle
|
source $bundlescript $(pwd)/bundles/$VERSION/$bundle
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
# We want this to fail if the bundles already exist and cannot be removed.
|
||||||
# We want this to fail if the bundles already exist.
|
|
||||||
# This is to avoid mixing bundles from different versions of the code.
|
# This is to avoid mixing bundles from different versions of the code.
|
||||||
mkdir -p bundles
|
mkdir -p bundles
|
||||||
if [ -e "bundles/$VERSION" ]; then
|
if [ -e "bundles/$VERSION" ]; then
|
||||||
echo "bundles/$VERSION already exists. Removing."
|
echo "bundles/$VERSION already exists. Removing."
|
||||||
rm -fr bundles/$VERSION && mkdir bundles/$VERSION || exit 1
|
rm -fr bundles/$VERSION && mkdir bundles/$VERSION || exit 1
|
||||||
|
echo
|
||||||
fi
|
fi
|
||||||
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
if [ $# -lt 1 ]; then
|
if [ $# -lt 1 ]; then
|
||||||
|
@ -73,19 +72,8 @@ main() {
|
||||||
fi
|
fi
|
||||||
for bundle in ${bundles[@]}; do
|
for bundle in ${bundles[@]}; do
|
||||||
bundle $SCRIPTDIR/make/$bundle
|
bundle $SCRIPTDIR/make/$bundle
|
||||||
|
echo
|
||||||
done
|
done
|
||||||
cat <<EOF
|
|
||||||
###############################################################################
|
|
||||||
Now run the resulting image, making sure that you set AWS_S3_BUCKET,
|
|
||||||
AWS_ACCESS_KEY, and AWS_SECRET_KEY environment variables:
|
|
||||||
|
|
||||||
docker run -e AWS_S3_BUCKET=get-staging.docker.io \\
|
|
||||||
AWS_ACCESS_KEY=AKI1234... \\
|
|
||||||
AWS_SECRET_KEY=sEs3mE... \\
|
|
||||||
GPG_PASSPHRASE=sesame... \\
|
|
||||||
image_id_or_name
|
|
||||||
###############################################################################
|
|
||||||
EOF
|
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
DEST=$1
|
DEST=$1
|
||||||
|
|
||||||
go build -o $DEST/docker-$VERSION -ldflags "$LDFLAGS" ./docker
|
go build -o $DEST/docker-$VERSION -ldflags "$LDFLAGS" ./docker
|
||||||
|
|
||||||
|
echo "Created binary: $DEST/docker-$VERSION"
|
||||||
|
|
Loading…
Reference in New Issue