{"id":44883792,"url":"https://github.com/kukymbr/goose-docker","last_synced_at":"2026-02-17T17:04:12.154Z","repository":{"id":173436481,"uuid":"650734208","full_name":"kukymbr/goose-docker","owner":"kukymbr","description":"Docker configuration for the goose migration tool","archived":false,"fork":false,"pushed_at":"2025-10-01T09:58:42.000Z","size":1409,"stargazers_count":24,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-01T11:32:27.506Z","etag":null,"topics":["database-management","database-migrations","docker","migration-tool","migrations"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kukymbr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-06-07T17:35:11.000Z","updated_at":"2025-10-01T09:58:46.000Z","dependencies_parsed_at":"2024-02-02T16:47:21.422Z","dependency_job_id":"7c76e8ca-a380-4627-b005-aa54cb2d6900","html_url":"https://github.com/kukymbr/goose-docker","commit_stats":null,"previous_names":["kukymbr/goose-docker"],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/kukymbr/goose-docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kukymbr%2Fgoose-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kukymbr%2Fgoose-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kukymbr%2Fgoose-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kukymbr%2Fgoose-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kukymbr","download_url":"https://codeload.github.com/kukymbr/goose-docker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kukymbr%2Fgoose-docker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29550871,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T14:33:00.708Z","status":"ssl_error","status_checked_at":"2026-02-17T14:32:58.657Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database-management","database-migrations","docker","migration-tool","migrations"],"created_at":"2026-02-17T17:04:11.471Z","updated_at":"2026-02-17T17:04:12.142Z","avatar_url":"https://github.com/kukymbr.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg align=\"right\" width=\"125\" src=\"assets/goose-in-box.png\" alt=\"image with a gopher in a goose costume in a box\"\u003e\n\n# [goose-docker](https://github.com/kukymbr/goose-docker)\n\n[![License](https://img.shields.io/github/license/kukymbr/goose-docker.svg)](https://github.com/kukymbr/goose-docker/blob/master/LICENSE)\n[![Release](https://img.shields.io/github/release/kukymbr/goose-docker.svg)](https://github.com/kukymbr/goose-docker/releases/latest)\n[![tests status](https://img.shields.io/github/actions/workflow/status/kukymbr/goose-docker/tests.yml?label=tests)](https://github.com/kukymbr/goose-docker/actions/workflows/tests.yml)\n[![image status](https://img.shields.io/github/actions/workflow/status/kukymbr/goose-docker/build_push.yml?label=image)](https://github.com/kukymbr/goose-docker/actions/workflows/build_push.yml)\n\nDocker configuration for the [pressly/goose](https://github.com/pressly/goose) migration tool.\n\nBased on ideas of the `gomicro/docker-goose` repository.\nFeatures:\n\n* No need to create your own Dockerfile (but you still may);\n* goose env vars are used;\n* docker compose usage;\n* all goose commands are available, not only `up`;\n* an image with a gopher in a goose costume in a box is even worse than an image with a gopher in a goose costume.\n\n## Pure goose command wrapper\n\nLooking for a pure goose wrapper with no sugar around?\n\n👉 Check out the [command wrapper mode](docs/command-wrapper.md) document.\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cb\u003eWhat's the difference?\u003c/b\u003e\u003c/summary\u003e\n\nThe pure command wrapper uses a `goose` command as a docker's entrypoint\ninstead of the [entrypoint.sh](entrypoint.sh) script:\n\n```Dockerfile\nENTRYPOINT [\"/bin/goose\"]\n```\n\nThis allows you to get a full control what are you passing to the `goose` command, for example:\n\n```shell\ndocker run --rm -v ./migrations:/migrations \\\n     -e GOOSE_MIGRATION_DIR=\"/migrations\" \\\n     -e GOOSE_DRIVER=\"postgres\" \\\n     ghcr.io/kukymbr/goose-docker-cmd:v3.26.0 \\\n     create my_new_feature sql\n```\n\nor:\n\n```shell\ndocker run --rm -v ./migrations:/migrations \\\n     ghcr.io/kukymbr/goose-docker-cmd:v3.26.0 \\\n     -dir=\"/migrations\" postgres \"user=postgres dbname=postgres sslmode=disable\" up-to 20230607203836\n```\n\n\u003c/details\u003e\n\n## Usage\n\n### Image Environment Variables\n\nThe image supports the following environment variables:\n\n| Variable            | Required | Description                                                                                                                                    | Default value |\n|---------------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------|---------------|\n| `GOOSE_DRIVER`      | ✅        | this should specify the database driver (e.g., `postgres`)                                                                                     | none          |\n| `GOOSE_DBSTRING`    | ✅        | specify the database connection parameters in this variable (e.g., `host=localhost port=5432 user=postgres password=postgres dbname=postgres`) | none          |\n| `GOOSE_COMMAND`     |          | the goose command to execute                                                                                                                   | `up`          |\n| `GOOSE_COMMAND_ARG` |          | argument for the goose command, for example, the `VERSION` argument for the `up-to`/`down-to` commands                                         | none          |\n| `GOOSE_EXTRA_ARGS`  |          | additional goose arguments, for example `GOOSE_EXTRA_ARGS=\"-table=_db_version -allow-missing\"`                                                 | none          |\n| `GOOSE_VERBOSE`     |          | if set to `true`, goose will be executed with the `-v` flag                                                                                    | `false`       |\n\nSee the [goose usage](https://github.com/pressly/goose#usage)\nfor available drivers, format of the connection string and available commands.\n\n#### .env file for a goose\n\nTo pass environment variables to the goose via the `.env` file\n(available in goose since v3.24.0,\nsee the [goose doc](https://github.com/pressly/goose#environment-variables) for info),\nmount `.env` file to the `/goose-docker` directory, for example:\n\n```shell\ndocker run --rm -v ./migrations:/migrations -v my_goose.env:/goose-docker/.env --network host \\\n  -e GOOSE_DRIVER=\"postgres\" \\\n  -e GOOSE_DBSTRING=\"host=localhost port=5432 user=postgres password=postgres dbname=postgres\" \\\n  ghcr.io/kukymbr/goose-docker:3.26.0\n```\n\n### Migration Files Directory\n\nThe image expects the `/migrations` directory to be mounted to the container,\nand it should contain your migration files.\n\n### Example Usage\n\nFor example, pure docker call:\n\n```shell\ndocker run --rm -v ./migrations:/migrations --network host \\\n  -e GOOSE_DRIVER=\"postgres\" \\\n  -e GOOSE_DBSTRING=\"host=localhost port=5432 user=postgres password=postgres dbname=postgres\" \\\n  ghcr.io/kukymbr/goose-docker:3.26.0\n```\n\nExample with `up-to` command:\n\n```shell\ndocker run --rm -v ./migrations:/migrations --network host \\\n  -e GOOSE_COMMAND=\"up-to\" \\\n  -e GOOSE_COMMAND_ARG=\"20230607203836\" \\\n  -e GOOSE_DRIVER=\"postgres\" \\\n  -e GOOSE_DBSTRING=\"host=localhost port=5432 user=postgres password=postgres dbname=postgres\" \\\n  ghcr.io/kukymbr/goose-docker:3.26.0\n```\n\nExample with `create` command (works since v3.20.0):\n\n```shell\ndocker run --rm -v ./migrations:/migrations \\\n  -e GOOSE_COMMAND=\"create\" \\\n  -e GOOSE_COMMAND_ARG=\"my_new_migration_name sql\" \\\n  ghcr.io/kukymbr/goose-docker:v3.26.0\n```\n\n### docker compose\n\nDocker compose example:\n\n```yaml\nservices:\n  # ... Add your DB service\n\n  migrations:\n    image: ghcr.io/kukymbr/goose-docker:3.26.0\n    environment:\n      - GOOSE_DRIVER=postgres\n      - GOOSE_DBSTRING=host=postgres port=5432 user=postgres password=postgres dbname=postgres\n    volumes:\n      - ./migrations:/migrations\n```\n\nSee the [compose.yml](compose.yml) file for the full example.\nAlso, the [tests/compose.yml](tests/compose.yml) file contains an example of usage with multiple databases.\n\n#### Overriding the environment variables\n\nIf you need to dynamically override the environment values provided in the docker compose or in the .env files,\nadd these variables into the `environment` section with a placeholder as a value, for example:\n\n```yaml\nmigrations:\n  # ...\n  environment:\n    - GOOSE_COMMAND=${GOOSE_COMMAND}\n    - GOOSE_COMMAND_ARG=${GOOSE_COMMAND_ARG}\n```\n\nWhen you can override the values:\n\n```shell\nGOOSE_COMMAND=\"create\" GOOSE_COMMAND_ARG=\"test_migration sql\" docker compose run --rm migrations\n```\n\n### Embedding migrations files\n\nIf you don't want or can't add migration files as a volume,\ncreate a `Dockerfile` extending the `goose-docker` image and add your files into it:\n\n```Dockerfile\nFROM ghcr.io/kukymbr/goose-docker:3.26.0\n\nADD /path/to/migrations /migrations\n```\n\nThen build it and use it instead of the `goose-docker` image as usual.\n\n### amd64/arm64 architecture\n\nThe ARM64 architecture support is added since the v3.23.0.\n\n### The `latest` tag notice\n\nThe `latest` tag of this image points to the latest commit to the `main` branch\nand not supposed to be used in the production. Always specify a semver tag for production use.\n\n## Contributing\n\nPlease refer the [CONTRIBUTING.md](CONTRIBUTING.md) for contribution info.\n\n## License\n\n[MIT licensed](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkukymbr%2Fgoose-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkukymbr%2Fgoose-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkukymbr%2Fgoose-docker/lists"}