forked from go-vela/vela-terraform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
44 lines (28 loc) · 1.68 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# SPDX-License-Identifier: Apache-2.0
# set a global Docker argument for the default CLI version
#
# https://github.com/moby/moby/issues/37345
ARG TERRAFORM_VERSION=1.7.4
################################################################################
## docker build --no-cache --target binary -t vela-terraform:binary . ##
################################################################################
FROM alpine:latest@sha256:c5b1261d6d3e43071626931fc004f70149baeba2c8ec672bd4f27761f8e1ad6b as binary
ARG TERRAFORM_VERSION
RUN wget -q https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip -O terraform.zip && \
unzip terraform.zip -d /bin && \
rm -f terraform.zip
##############################################################################
## docker build --no-cache --target certs -t vela-terraform:certs . ##
##############################################################################
FROM alpine:latest@sha256:c5b1261d6d3e43071626931fc004f70149baeba2c8ec672bd4f27761f8e1ad6b as certs
RUN apk add --update --no-cache ca-certificates curl
###############################################################
## docker build --no-cache -t vela-terraform:local . ##
###############################################################
FROM alpine:3.19.1@sha256:c5b1261d6d3e43071626931fc004f70149baeba2c8ec672bd4f27761f8e1ad6b
ARG TERRAFORM_VERSION
ENV PLUGIN_TERRAFORM_VERSION=${TERRAFORM_VERSION}
COPY --from=binary /bin/terraform /bin/terraform
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY release/vela-terraform /bin/terraform-plugin
ENTRYPOINT ["/bin/terraform-plugin"]