forked from carlosedp/riscv-bringup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.traefik
47 lines (31 loc) · 981 Bytes
/
Dockerfile.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Run: docker build -t carlosedp/traefik -f Dockerfile.traefik .
# FETCH
FROM alpine:3 as gitfetch
RUN apk add --no-cache git
RUN git clone --depth 1 https://github.com/traefik/traefik.git /traefik
# WEBUI
FROM node:12.11 as webui
RUN mkdir -p /src/webui
COPY --from=gitfetch /traefik/webui/ /src/webui/
WORKDIR /src/webui
RUN npm install
RUN npm run build
# BUILD
FROM golang:1.17 as gobuild
COPY --from=gitfetch /traefik /go/src/github.com/traefik/traefik
WORKDIR /go/src/github.com/traefik/traefik
RUN rm -rf /go/src/github.com/traefik/traefik/webui/static/
COPY --from=webui /src/webui/static/ /go/src/github.com/traefik/traefik/webui/static/
# required to merge non-code components into the final binary,
# such as the web dashboard/UI
RUN go generate
# cross-compile
ENV GOARCH=riscv64
ENV GOOS=linux
# Standard go build
RUN mkdir dist
RUN go build -o dist/traefik ./cmd/traefik
RUN chmod +x dist/traefik
EXPOSE 80
VOLUME ["/tmp"]
ENTRYPOINT ["dist/traefik"]