-
Notifications
You must be signed in to change notification settings - Fork 27
/
Dockerfile
38 lines (25 loc) · 882 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
35
36
37
38
# Use go-toolset as the builder image
# Once built, copy to a smaller image and run from there
FROM registry.access.redhat.com/ubi8/go-toolset as builder
WORKDIR /go/src/app
COPY go.mod go.sum ./
RUN go mod download
COPY internal/ internal/
COPY cmd/ cmd/
COPY db/ db/
COPY Makefile .
USER root
RUN make build
# Using ubi8-minimal due to its smaller footprint
FROM registry.access.redhat.com/ubi8/ubi-minimal
RUN microdnf update -y
WORKDIR /
# Copy executable files from the builder image
COPY --from=builder /go/src/app/cloud-connector /cloud-connector
COPY --from=builder /go/src/app/migrate_db /migrate_db
COPY --from=builder /go/src/app/db/migrations /db/migrations/
COPY --from=builder /go/src/app/db_schema_dumper /db_schema_dumper
COPY --from=builder /go/src/app/stage_db_fixer /stage_db_fixer
COPY licenses/LICENSE /licenses/LICENSE
USER 1001
EXPOSE 8000 10000