From 909c45488f18ca4ed09f49eaf02f1181264abd2e Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Wed, 19 Jul 2017 12:40:21 -0700 Subject: [PATCH] build: Move the "full" Dockerfile into the root of our main repo Previously this lived in a separate repo docker-hub-images, shared with other products. Having multiple products sharing a repo complicates release processes and works against some assumptions made by the Dockerhub build system. The "full" Dockerfile contains a Terraform binary built from source, and so it can be used with any arbitrary Terraform source tree. This doesn't yet include the "light" Dockerfile, which instead makes an image from official binaries already on releases.hashicorp.com. That will follow in a subsequent commit. --- Dockerfile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..d435c9f91 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +# This Dockerfile builds on golang:alpine by building Terraform from source +# using the current working directory. +# +# This produces a docker image that contains a working Terraform binary along +# with all of its source code, which is what gets released on hub.docker.com +# as terraform:full. The main releases (terraform:latest, terraform:light and +# the release tags) are lighter images including only the officially-released +# binary from releases.hashicorp.com; these are built instead from +# scripts/docker-release/Dockerfile-release. + +FROM golang:alpine +MAINTAINER "HashiCorp Terraform Team " + +RUN apk add --update git bash openssh + +ENV TF_DEV=true + +WORKDIR $GOPATH/src/github.com/hashicorp/terraform +COPY . . +RUN /bin/bash scripts/build.sh + +WORKDIR $GOPATH +ENTRYPOINT ["terraform"]