forked from RedHatInsights/entitlements-api-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (23 loc) · 834 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
34
# 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.20 as builder
FROM registry.access.redhat.com/ubi8/go-toolset:1.21.13 as builder
WORKDIR /go/src/app
COPY go.mod go.sum ./
USER root
RUN go mod download
COPY . .
RUN make
# Using ubi8-minimal due to its smaller footprint
FROM registry.access.redhat.com/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"]