-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (22 loc) · 769 Bytes
/
Dockerfile
File metadata and controls
27 lines (22 loc) · 769 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
27
# this is just a common layer to use local and builds
FROM golang:1.18-alpine as base
RUN apk --no-cache update && apk add --no-cache git ca-certificates
RUN update-ca-certificates
# this layer is reponsable to execute tests in cicle-ci
FROM base as ci
WORKDIR /app/
COPY . .
# the build layer responsable to create the entrypoint
FROM ci as builder
WORKDIR /app/
RUN go mod tidy
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o entrypoint
# the shipment layer
FROM scratch
WORKDIR /
COPY liquibase/migrations.yaml .
COPY --from=base /usr/local/share/ca-certificates /usr/local/share/ca-certificates
COPY --from=base /etc/ssl/certs /etc/ssl/certs/
COPY --from=builder /app/entrypoint .
COPY --from=builder /app/rev.txt .
ENTRYPOINT [ "/entrypoint" ]