-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (29 loc) · 1.09 KB
/
Copy pathDockerfile
File metadata and controls
33 lines (29 loc) · 1.09 KB
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
ARG TF_IMAGE=1.9.8
FROM alpine/k8s:1.20.7 AS k8s
FROM ubuntu:20.04 AS irsa-tokengen
WORKDIR /workdir
RUN mkdir bin
RUN apt update && apt install wget -y
RUN wget https://github.com/isaaguilar/irsa-tokengen/releases/download/v1.0.0/irsa-tokengen-v1.0.0-linux-amd64.tgz && \
tar xzf irsa-tokengen-v1.0.0-linux-amd64.tgz && mv irsa-tokengen bin/irsa-tokengen
FROM docker.io/library/alpine AS entrypoint
RUN apk add clang curl-dev build-base util-linux-dev
WORKDIR /workdir
COPY entrypoint /workdir
RUN clang++ -static-libgcc -static-libstdc++ -std=c++17 entrypoint.cpp -lcurl -o entrypoint
FROM ubuntu:latest AS bin
WORKDIR /workdir
RUN mkdir bin
COPY --from=k8s /usr/bin/kubectl bin/kubectl
COPY --from=irsa-tokengen /workdir/bin/irsa-tokengen bin/irsa-tokengen
COPY --from=entrypoint /workdir/entrypoint bin/entrypoint
FROM hashicorp/terraform:${TF_IMAGE}
RUN apk add bash jq
COPY --from=bin /workdir/bin /usr/local/bin
ENV USER_UID=2000 \
USER_NAME=tfo-runner \
HOME=/home/tfo-runner
COPY usersetup /usersetup
RUN chmod +x /usersetup && /usersetup
USER 2000
ENTRYPOINT ["/usr/local/bin/entrypoint"]