-
Notifications
You must be signed in to change notification settings - Fork 3
/
script-amd64.Dockerfile
32 lines (27 loc) · 1.08 KB
/
script-amd64.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
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 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
FROM docker.io/ubuntu:latest as entrypoint
RUN apt update && apt install clang libcurl4-gnutls-dev uuid-dev -y
WORKDIR /workdir
COPY entrypoint /workdir
RUN clang++ -static-libgcc -static-libstdc++ -std=c++17 entrypoint.cpp -lcurl -o entrypoint
FROM docker.io/ubuntu:latest
ENV USER_UID=2000 \
USER_NAME=tfo-runner \
HOME=/home/tfo-runner
COPY usersetup script-toolset.sh /
RUN /script-toolset.sh && /usersetup
COPY --from=bin /workdir/bin /usr/local/bin
COPY --from=entrypoint /workdir/entrypoint /usr/local/bin/entrypoint
USER 2000
ENTRYPOINT ["/usr/local/bin/entrypoint"]