Sign inSign up

juhokoskela/goose

By juhokoskela

Updated 18 days ago

A database migration tool for Go. Supports SQL migrations and Go functions.

Image
Databases & storage
1

2.7K

juhokoskela/goose repository overview

goose

Lightweight container image for the goose database migration CLI. The image embeds the official binary built from github.com/pressly/goose and runs as a non-root user on a distroless base.

Features

  • Ships a single static goose binary with all database drivers enabled by default.
  • Multi-architecture builds supported (linux/amd64, linux/arm64, …) via Docker Buildx.
  • Distroless runtime keeps the image size minimal and surface area small.
  • Uses /migrations as the working directory so mounting migrations is straightforward.

Quick start

docker run --rm \
  -v "$(pwd)/migrations:/migrations:ro" \
  -e GOOSE_DRIVER=sqlite3 \
  -e GOOSE_DBSTRING=./example.db \
  juhokoskela/goose:latest \
  status

Environment variables map directly to the CLI flags:

  • GOOSE_DRIVER – database driver (postgres, mysql, sqlite3, …).
  • GOOSE_DBSTRING – connection string or DSN.
  • GOOSE_MIGRATION_DIR – optional override if migrations live outside /migrations.

Available tags

  • latest – default build including all drivers. Based on the latest version of Goose and Go.

Building locally

git clone https://github.com/juhokoskela/goose.git
cd goose
docker build -t goose:local .

Alternatively, build with Goose build tags if you want a custom variant with unused drivers removed for example

git clone https://github.com/juhokoskela/goose.git
cd goose
docker build -t goose:local --build-arg GOOSE_BUILD_TAGS="no_mysql no_postgres" .

Source & issues

Tag summary

Content type

Image

Digest

sha256:7cbac7622

Size

14.6 MB

Last updated

18 days ago

docker pull juhokoskela/goose