-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContainerfile.traefik
31 lines (22 loc) · 1.05 KB
/
Containerfile.traefik
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
## build with podman build -f Containerfile.traefik -t traefik && podman run --rm --rmi -it traefik
# Repo to clone from
ARG URL=https://api.github.com/repos/traefik/traefik/releases/latest
FROM quay.io/almalinuxorg/9-minimal AS builder
RUN microdnf install --assumeyes gcc tar ca-certificates golang wget rsync jq
RUN rpm -ql ca-certificates | \
grep -v -e "/man8/" > rpms.txt
RUN rsync -v -L -a -R --files-from="rpms.txt" / /rpms
# Grab tarball of latest release
ARG URL
RUN curl $URL | jq -r ".name" > VER.txt
RUN echo $(cat VER.txt)_linux_amd64.tar.gz > FILE.txt
RUN wget "https://github.com/traefik/traefik/releases/download/$(cat VER.txt)/traefik_$(cat FILE.txt)"
RUN wget -q -O- "https://github.com/traefik/traefik/releases/download/$(cat VER.txt)/traefik_$(cat VER.txt)_checksums.txt" | grep -q "$(sha256sum traefik_$(cat FILE.txt))"
RUN tar -xf traefik_$(cat FILE.txt) -C /root
# Create final image
FROM quay.io/almalinuxorg/9-micro
COPY --from=builder /rpms .
WORKDIR /root
COPY --from=builder /root/traefik /root
EXPOSE 80
ENTRYPOINT ["./traefik"]