forked from lukaszbudnik/migrator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
27 lines (17 loc) · 595 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
FROM golang:1.19.3-alpine3.15 as builder
LABEL org.opencontainers.image.authors="Łukasz Budnik <lukasz.budnik@gmail.com>"
ARG GIT_REF
ARG GIT_SHA
# build migrator
RUN mkdir -p /go/migrator
COPY . /go/migrator
RUN cd /go/migrator && \
go build -ldflags "-X main.GitSha=$GIT_SHA -X main.GitRef=$GIT_REF"
FROM alpine:3.20.3
LABEL org.opencontainers.image.authors="Łukasz Budnik <lukasz.budnik@gmail.com>"
COPY --from=builder /go/migrator/migrator /bin
VOLUME ["/data"]
# copy and register entrypoint script
COPY docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
EXPOSE 8080