Skip to content

Commit c36cbb2

Browse files
authored
Add GCP Cloud SDK to Terraform deployer image (#638)
* update terraform deployer image Terraform deployer image may need some additional Cloud Service Provider specific tooling to handle corner cases not handled by Terraform itself. In this case this commits adds support for `bq` tool from GCP Cloud SDK. As `bq` and the entire GCP Cloud SDK requires python, is easy to add AWS or Azure dedicated tooling in the future (as both are Python-based). * install git and openssh * skip using apk cache * cleanup google cloud SDK archive
1 parent 65f8e5e commit c36cbb2

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed
Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
1-
FROM hashicorp/terraform:light
2-
ENV TF_IN_AUTOMATION=true
1+
FROM hashicorp/terraform:light as terraform
2+
3+
FROM python:3-alpine
4+
5+
# required by gcloud SDK
6+
RUN apk add --no-cache git openssh curl
7+
8+
ENV GCLOUD_SDK_VERSION 367.0.0
9+
ENV PATH $PATH:/usr/local/gcloud/google-cloud-sdk/bin
10+
RUN curl "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-$GCLOUD_SDK_VERSION-linux-x86_64.tar.gz" > /tmp/google-cloud-sdk.tar.gz \
11+
&& mkdir -p /usr/local/gcloud \
12+
&& tar -C /usr/local/gcloud -xvf /tmp/google-cloud-sdk.tar.gz \
13+
&& /usr/local/gcloud/google-cloud-sdk/install.sh -q --override-components="bq" \
14+
&& rm /tmp/google-cloud-sdk.tar.gz
15+
316
HEALTHCHECK --timeout=3s CMD sh -c "[ -f /tmp/tf-applied ]"
17+
18+
COPY --from=terraform /bin/terraform /usr/bin/terraform
19+
20+
ENV TF_IN_AUTOMATION=true
421
ADD run.sh /
522
WORKDIR /workspace
23+
624
ENTRYPOINT sh /run.sh

0 commit comments

Comments
 (0)