-
Notifications
You must be signed in to change notification settings - Fork 141
/
runner.Dockerfile.dev
44 lines (30 loc) · 1.05 KB
/
runner.Dockerfile.dev
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
FROM alpine:3.20 as base
LABEL org.opencontainers.image.source="https://github.com/flux-iac/tofu-controller"
ARG LIBCRYPTO_VERSION
RUN apk update && \
apk add --no-cache \
busybox \
ca-certificates \
git \
gnupg \
libcrypto3=${LIBCRYPTO_VERSION} \
libssl3=${LIBCRYPTO_VERSION} \
libretls \
openssh-client \
tini
RUN addgroup --gid 65532 -S runner && adduser --uid 65532 -S runner -G runner
USER 65532:65532
ENV GNUPGHOME=/tmp
ENTRYPOINT [ "/sbin/tini", "--", "tf-runner" ]
FROM base
ARG TARGETARCH
ARG TF_VERSION=1.5.7
# Switch to root to have permissions for operations
USER root
ADD https://releases.hashicorp.com/terraform/${TF_VERSION}/terraform_${TF_VERSION}_linux_${TARGETARCH}.zip /terraform_${TF_VERSION}_linux_${TARGETARCH}.zip
RUN unzip -q /terraform_${TF_VERSION}_linux_${TARGETARCH}.zip -d /usr/local/bin/ && \
rm /terraform_${TF_VERSION}_linux_${TARGETARCH}.zip && \
chmod +x /usr/local/bin/terraform
# Switch back to the non-root user after operations
USER 65532:65532
COPY bin/tf-runner /usr/local/bin/