{"id":16003445,"url":"https://github.com/nhatthm/testcontainers-go-registry","last_synced_at":"2025-03-17T14:31:49.375Z","repository":{"id":37410893,"uuid":"454079528","full_name":"nhatthm/testcontainers-go-registry","owner":"nhatthm","description":"Common Image Registry for Testcontainers-Go","archived":false,"fork":false,"pushed_at":"2024-05-01T08:35:43.000Z","size":868,"stargazers_count":4,"open_issues_count":8,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-01T21:04:59.655Z","etag":null,"topics":["container","docker","go","golang","image-registry","test","test-integration","testcontainers","testcontainers-go","testcontainers-go-contrib"],"latest_commit_sha":null,"homepage":"","language":"Go","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/nhatthm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2022-01-31T16:20:41.000Z","updated_at":"2024-05-16T08:50:13.802Z","dependencies_parsed_at":"2023-01-31T11:31:10.040Z","dependency_job_id":"a973490e-d2b3-49b2-9455-3ea43caede66","html_url":"https://github.com/nhatthm/testcontainers-go-registry","commit_stats":null,"previous_names":[],"tags_count":81,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhatthm%2Ftestcontainers-go-registry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhatthm%2Ftestcontainers-go-registry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhatthm%2Ftestcontainers-go-registry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhatthm%2Ftestcontainers-go-registry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nhatthm","download_url":"https://codeload.github.com/nhatthm/testcontainers-go-registry/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243864822,"owners_count":20360360,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["container","docker","go","golang","image-registry","test","test-integration","testcontainers","testcontainers-go","testcontainers-go-contrib"],"created_at":"2024-10-08T10:20:42.616Z","updated_at":"2025-03-17T14:31:49.091Z","avatar_url":"https://github.com/nhatthm.png","language":"Go","funding_links":["https://www.paypal.com/donate/?hosted_button_id=PJZSGJN57TDJY"],"categories":[],"sub_categories":[],"readme":"# Testcontainers-Go Common Image Registry\n\n[![GitHub Releases](https://img.shields.io/github/v/release/nhatthm/testcontainers-go-registry)](https://github.com/nhatthm/testcontainers-go-registry/releases/latest)\n[![Build Status](https://github.com/nhatthm/testcontainers-go-registry/actions/workflows/test.yaml/badge.svg)](https://github.com/nhatthm/testcontainers-go-registry/actions/workflows/test.yaml)\n[![codecov](https://codecov.io/gh/nhatthm/testcontainers-go-registry/branch/master/graph/badge.svg?token=eTdAgDE2vR)](https://codecov.io/gh/nhatthm/testcontainers-go-registry)\n[![Go Report Card](https://goreportcard.com/badge/go.nhat.io/testcontainers-registry)](https://goreportcard.com/report/go.nhat.io/testcontainers-registry)\n[![GoDevDoc](https://img.shields.io/badge/dev-doc-00ADD8?logo=go)](https://pkg.go.dev/go.nhat.io/testcontainers-registry)\n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/donate/?hosted_button_id=PJZSGJN57TDJY)\n\nCommon Image Registry for Testcontainers-Go\n\n## Prerequisites\n\n- `Go \u003e= 1.22`\n\n## Install\n\n```bash\ngo get go.nhat.io/testcontainers-registry\n```\n\n## Elasticsearch\n\n```go\npackage example\n\nimport (\n\t\"context\"\n\n\tes \"go.nhat.io/testcontainers-registry/elasticsearch\"\n\ttestcontainers \"go.nhat.io/testcontainers-extra\"\n)\n\nconst (\n\tdbName          = \"test\"\n\tmigrationSource = \"file://./resources/migrations/\"\n)\n\nfunc startElasticsearch() (testcontainers.Container, error) {\n\treturn es.StartGenericContainer(context.Background())\n}\n```\n\n## Mongo\n\n```go\npackage example\n\nimport (\n\t\"context\"\n\n\t\"go.nhat.io/testcontainers-registry/mongo\"\n\ttestcontainers \"go.nhat.io/testcontainers-extra\"\n)\n\nconst (\n\tdbName          = \"test\"\n\tmigrationSource = \"file://./resources/migrations/\"\n)\n\nfunc startMongoDB() (testcontainers.Container, error) {\n\treturn mongo.StartGenericContainer(context.Background(),\n\t\tmongo.RunMigrations(migrationSource, dbName),\n\t)\n}\n```\n\n## MySQL\n\n```go\npackage example\n\nimport (\n\t\"context\"\n\n\t\"go.nhat.io/testcontainers-registry/mysql\"\n\ttestcontainers \"go.nhat.io/testcontainers-extra\"\n)\n\nconst (\n\tdbName          = \"test\"\n\tdbUser          = \"test\"\n\tdbPassword      = \"test\"\n\tmigrationSource = \"file://./resources/migrations/\"\n)\n\nfunc startMySQL() (testcontainers.Container, error) {\n\treturn mysql.StartGenericContainer(context.Background(),\n\t\tdbName, dbUser, dbPassword,\n\t\tmysql.RunMigrations(migrationSource),\n\t)\n}\n```\n\n## Postgres\n\n```go\npackage example\n\nimport (\n\t\"context\"\n\n\t\"go.nhat.io/testcontainers-registry/postgres\"\n\ttestcontainers \"go.nhat.io/testcontainers-extra\"\n)\n\nconst (\n\tdbName          = \"test\"\n\tdbUser          = \"test\"\n\tdbPassword      = \"test\"\n\tmigrationSource = \"file://./resources/migrations/\"\n)\n\nfunc startPostgres() (testcontainers.Container, error) {\n\treturn postgres.StartGenericContainer(context.Background(),\n\t\tdbName, dbUser, dbPassword,\n\t\tpostgres.RunMigrations(migrationSource),\n\t)\n}\n```\n\n## SQL Server\n\n```go\npackage example\n\nimport (\n\t\"context\"\n\n\ttestcontainers \"go.nhat.io/testcontainers-extra\"\n\t\"go.nhat.io/testcontainers-registry/mssql\"\n)\n\nconst (\n\tdbName          = \"test\"\n\tdbPassword      = \"My!StrongPassword\"\n\tmigrationSource = \"file://./resources/migrations/\"\n)\n\nfunc startSQLServer() (testcontainers.Container, error) {\n\treturn mssql.StartGenericContainer(context.Background(),\n\t\tdbName, dbPassword,\n\t\tmssql.RunMigrations(migrationSource),\n\t)\n}\n```\n\n## Options\n\n### Change Image Tag\n\n```go\npackage example\n\nimport (\n\t\"context\"\n\n\t\"go.nhat.io/testcontainers-registry/postgres\"\n\ttestcontainers \"go.nhat.io/testcontainers-extra\"\n)\n\nconst (\n\tdbName     = \"test\"\n\tdbUser     = \"test\"\n\tdbPassword = \"test\"\n)\n\nfunc startPostgres() (testcontainers.Container, error) {\n\treturn postgres.StartGenericContainer(context.Background(),\n\t\tdbName, dbUser, dbPassword,\n\t\ttestcontainers.WithImageTag(\"13-alpine\"),\n\t)\n}\n```\n\n### Change Image Name\n\n```go\npackage example\n\nimport (\n\t\"context\"\n\n\ttestcontainers \"go.nhat.io/testcontainers-extra\"\n\t\"go.nhat.io/testcontainers-registry/mysql\"\n)\n\nconst (\n\tdbName     = \"test\"\n\tdbUser     = \"test\"\n\tdbPassword = \"test\"\n)\n\nfunc startMySQL() (testcontainers.Container, error) {\n\treturn mysql.StartGenericContainer(context.Background(),\n\t\tdbName, dbUser, dbPassword,\n\t\ttestcontainers.WithImageName(\"mariadb\"),\n\t\ttestcontainers.WithImageTag(\"10.7\"),\n\t)\n}\n```\n\n## Donation\n\nIf this project help you reduce time to develop, you can give me a cup of coffee :)\n\n### Paypal donation\n\n[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/donate/?hosted_button_id=PJZSGJN57TDJY)\n\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;or scan this\n\n\u003cimg src=\"https://user-images.githubusercontent.com/1154587/113494222-ad8cb200-94e6-11eb-9ef3-eb883ada222a.png\" width=\"147px\" /\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnhatthm%2Ftestcontainers-go-registry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnhatthm%2Ftestcontainers-go-registry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnhatthm%2Ftestcontainers-go-registry/lists"}