-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (22 loc) · 798 Bytes
/
Dockerfile
File metadata and controls
30 lines (22 loc) · 798 Bytes
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
FROM golang:1.26-alpine AS golang-builder
RUN addgroup -S ctf && adduser -S ctf -G ctf
WORKDIR /src/app
COPY --chown=ctf:ctf . .
RUN go get
RUN go build
RUN apk add wget unzip
RUN wget https://github.com/twbs/bootstrap/releases/download/v5.3.7/bootstrap-5.3.7-dist.zip
RUN wget https://icons.getbootstrap.com/assets/icons/brightness-high-fill.svg
RUN wget https://icons.getbootstrap.com/assets/icons/moon-stars-fill.svg
RUN unzip bootstrap-*.zip
RUN mv bootstrap-*-dist static
RUN mv brightness-high-fill.svg static/
RUN mv moon-stars-fill.svg static/
FROM scratch
COPY --from=golang-builder /src/app/ctf /ctf
COPY --from=golang-builder /etc/passwd /etc/passwd
COPY --from=golang-builder /src/app/static /static
COPY --chown=ctf:ctf templates /templates
USER ctf
EXPOSE 8080
CMD [ "/ctf" ]