forked from RedHatInsights/entitlements-api-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (22 loc) · 755 Bytes
/
Dockerfile
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
# Manual Build: YYYY-MM-DD
# Use go-toolset as the builder image
# Once built, copys GO executable to a smaller image and runs it from there
# FROM registry.redhat.io/ubi8/go-toolset as builder
FROM quay.io/projectquay/golang:1.19 as builder
WORKDIR /go/src/app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
USER 0
RUN make
# Using ubi8-minimal due to its smaller footprint
FROM registry.redhat.io/ubi8/ubi-minimal
WORKDIR /
# Copy GO executable file and need directories from the builder image
COPY --from=builder /go/src/app/entitlements-api-go ./entitlements-api-go
COPY --from=builder /go/src/app/bundle-sync ./bundle-sync
COPY resources ./resources
COPY apispec ./apispec
COPY bundles ./bundles
USER 1001
CMD ["/entitlements-api-go"]