At $EMPLOYER, I'm currently pushing for standardization on Postgres + Goose as the official database solution.
The biggest problem is that there is no standard, official public Dockerhub image for Goose, which would make it much easier to spin up a separate migrations image to run as a k8s job. Most of the unofficial Goose images have not been updated in years, and others are doing things like curl ing the amd64 binaries, which then makes it impossible to use on aarch64 servers.
I would like an official FROM scratch image that just contains the binary of each Goose release, available for amd64 or aarch64. Something like:
# syntax=docker/dockerfile:1
FROM golang:1.26-alpine AS build
WORKDIR /app
RUN apk update
# This should be the same as the version it is tagged as
ARG VERSION
RUN GOPATH=/app go install github.com/pressly/goose/v3/cmd/goose@${VERSION}
FROM scratch
WORKDIR /
COPY --from=build /app/bin/goose /
ENTRYPOINT ["./goose"]
From that base image, we could then choose the version of Goose that we want, COPY the migrations folder, and run it from a k8s job with appropriate env. vars.
At
$EMPLOYER, I'm currently pushing for standardization on Postgres + Goose as the official database solution.The biggest problem is that there is no standard, official public Dockerhub image for Goose, which would make it much easier to spin up a separate migrations image to run as a k8s job. Most of the unofficial Goose images have not been updated in years, and others are doing things like
curling the amd64 binaries, which then makes it impossible to use on aarch64 servers.I would like an official
FROM scratchimage that just contains the binary of each Goose release, available for amd64 or aarch64. Something like:From that base image, we could then choose the version of Goose that we want,
COPYthe migrations folder, and run it from a k8s job with appropriate env. vars.