evilthings/Dockerfile

24 lines
409 B
Text
Raw Normal View History

2024-01-09 10:48:44 +00:00
# syntax=docker/dockerfile:1
FROM golang:1.21 AS build-stage
WORKDIR /app
COPY go.mod ./
2024-01-23 14:03:52 +00:00
COPY go.sum ./
2024-01-09 10:48:44 +00:00
RUN go mod download
COPY *.go ./
COPY ./templates/ ./templates/
RUN CGO_ENABLED=0 GOOS=linux go build -o /evilthings
FROM gcr.io/distroless/base-debian11 AS build-release-stage
WORKDIR /
COPY --from=build-stage /evilthings /evilthings
EXPOSE 8080
USER nonroot:nonroot
ENTRYPOINT [ "/evilthings" ]