Add Docker labels.

This commit is contained in:
David Newhall II
2019-07-08 12:10:37 -07:00
parent b735c92af9
commit 2143f54a74
3 changed files with 42 additions and 6 deletions

View File

@@ -7,6 +7,10 @@ set -e -o pipefail
# The Docker Cloud config must pass in the BUILDS env variable.
# See README.md (in this dir) and the screenshot for more info.
VERSION=$(git tag -l --merged | tail -n1 | tr -d v) # 1.2.3
DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ)
COMMIT=$(git rev-parse --short HEAD)
# Build each configured image from Docker Cloud.
for build in $BUILDS; do
# os:name:arch:variant
@@ -15,6 +19,9 @@ for build in $BUILDS; do
echo "Building Image ${IMAGE_NAME}_${os}_${name}"
docker build \
--build-arg "ARCH=${name}" \
--build-arg "BUILD_DATE=${DATE}" \
--build-arg "COMMIT=${COMMIT}" \
--build-arg "VERSION=${VERSION}" \
--tag "${IMAGE_NAME}_${os}_${name}" \
--file Dockerfile ../..
done