-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (22 loc) · 748 Bytes
/
Dockerfile
File metadata and controls
36 lines (22 loc) · 748 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
28
29
30
31
32
33
34
35
36
# syntax=docker/dockerfile:1
FROM golang:1.23.0-alpine AS builder
ARG APP_VERSION="undefined"
ARG BUILD_TIME="undefined"
ARG GOOSE_VERSION="v3.24.0"
WORKDIR /go/src/github.com/pressly/goose
RUN apk add git
RUN git clone https://github.com/pressly/goose --branch $GOOSE_VERSION --single-branch .
RUN go mod download
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
go build -trimpath \
-ldflags="-s -w" \
-tags="no_clickhouse no_libsql no_mssql no_mysql no_sqlite3 no_vertica no_ydb" \
-o /go/bin/goose \
./cmd/goose
######################################################
FROM scratch
WORKDIR /migrations
COPY --from=builder /go/bin/goose /go/bin/goose
EXPOSE 8000
ENV GOOSE_DRIVER=postgres
ENTRYPOINT ["/go/bin/goose"]