github.com/sl1pm4t/terraform@v0.6.4-0.20170725213156-870617d22df3/scripts/docker-release/hooks/build (about)

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