elinuxhenrik | c78feea | 2022-04-07 17:01:47 +0200 | [diff] [blame] | 1 | ## |
| 2 | ## Build |
| 3 | ## |
| 4 | FROM golang:1.17.1-bullseye AS build |
| 5 | |
| 6 | WORKDIR /app |
| 7 | |
| 8 | COPY go.mod ./ |
| 9 | COPY go.sum ./ |
| 10 | RUN go mod download |
| 11 | |
| 12 | COPY . ./ |
| 13 | |
| 14 | RUN go build -o /docker-oruclosedloop |
| 15 | |
| 16 | ## |
| 17 | ## Deploy |
| 18 | ## |
elinuxhenrik | c7847c9 | 2022-06-02 14:48:38 +0200 | [diff] [blame] | 19 | FROM gcr.io/distroless/base-debian11 |
elinuxhenrik | c78feea | 2022-04-07 17:01:47 +0200 | [diff] [blame] | 20 | |
| 21 | WORKDIR / |
| 22 | |
| 23 | ## Copy from "build" stage |
| 24 | COPY --from=build /docker-oruclosedloop . |
elinuxhenrik | c7847c9 | 2022-06-02 14:48:38 +0200 | [diff] [blame] | 25 | COPY --from=build /app/security/* /security/ |
elinuxhenrik | c78feea | 2022-04-07 17:01:47 +0200 | [diff] [blame] | 26 | COPY --from=build /app/o-ru-to-o-du-map.csv . |
| 27 | |
| 28 | USER nonroot:nonroot |
| 29 | |
| 30 | ENTRYPOINT ["/docker-oruclosedloop"] |