forked from RedHatInsights/quickstarts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (19 loc) · 662 Bytes
/
Dockerfile
File metadata and controls
26 lines (19 loc) · 662 Bytes
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
FROM registry.redhat.io/rhel8/go-toolset:1.15 AS builder
WORKDIR $GOPATH/src/mypackage/myapp/
COPY . .
ENV GO111MODULE=on
USER root
RUN go get -d -v
RUN make validate
RUN make test
RUN CGO_ENABLED=0 go build -o /go/bin/quickstarts
# Build the migration binary.
RUN CGO_ENABLED=0 go build -o /go/bin/quickstarts-migrate cmd/migrate/migrate.go
FROM registry.redhat.io/ubi8-minimal:latest
COPY --from=builder /go/bin/quickstarts /usr/bin
COPY --from=builder /go/bin/quickstarts-migrate /usr/bin
COPY --from=builder /src/mypackage/myapp/spec/openapi.json /var/tmp
COPY --from=builder /src/mypackage/myapp/docs /docs
USER 1001
CMD ["quickstarts"]
EXPOSE 8000