Files
opentf/scripts/docker-release/hooks/build
Martin Atkins 0f9af4dfa9 build: configuration for building "release" docker images
These are different than our "full" images because they include a binary
already released to releases.hashicorp.com, whereas the root Dockerfile
directly builds from the current work tree.

This particular Dockerfile is not intended to be run manually, but rather
exists only to drive the dockerhub automated build.
2017-07-19 12:59:13 -07:00

19 lines
668 B
Bash
Executable File

#!/bin/bash
# This script assumes that its working directory is the parent directory,
# where the Dockerfile-release file is located, since that's how Dockerhub
# runs hooks.
set -eu
# We assume that this is always running while git HEAD is pointed at a release
# tag or a branch that is pointed at the same commit as a release tag. If not,
# this will fail since we can't build a release image for a commit that hasn't
# actually been released.
VERSION="$(git describe)"
echo "Building release docker images for version $VERSION"
VERSION_SLUG="${VERSION#v}"
docker build "--build-arg=TERRAFORM_VERSION=${VERSION_SLUG}" -t ${IMAGE_NAME} -f "Dockerfile-release" .