{"id":26499710,"url":"https://github.com/cockroachlabs-field/cockroachdb-single-node","last_synced_at":"2025-03-20T15:18:50.377Z","repository":{"id":63769725,"uuid":"414360023","full_name":"cockroachlabs-field/cockroachdb-single-node","owner":"cockroachlabs-field","description":"Simple Docker image that starts a single CockroachDB database node. Great for CI/CD pipelines!","archived":false,"fork":false,"pushed_at":"2022-12-24T22:49:49.000Z","size":14,"stargazers_count":4,"open_issues_count":1,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-01-22T18:06:32.188Z","etag":null,"topics":["cockroachdb","docker","github-actions"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cockroachlabs-field.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-06T20:26:25.000Z","updated_at":"2024-01-22T18:06:32.190Z","dependencies_parsed_at":"2022-11-25T17:17:16.615Z","dependency_job_id":null,"html_url":"https://github.com/cockroachlabs-field/cockroachdb-single-node","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cockroachlabs-field%2Fcockroachdb-single-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cockroachlabs-field%2Fcockroachdb-single-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cockroachlabs-field%2Fcockroachdb-single-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cockroachlabs-field%2Fcockroachdb-single-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cockroachlabs-field","download_url":"https://codeload.github.com/cockroachlabs-field/cockroachdb-single-node/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244637102,"owners_count":20485446,"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":["cockroachdb","docker","github-actions"],"created_at":"2025-03-20T15:18:49.852Z","updated_at":"2025-03-20T15:18:50.370Z","avatar_url":"https://github.com/cockroachlabs-field.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CockroachDB Single Node\nThis project creates a simple [CockroachDB](https://www.cockroachlabs.com/) Docker image that is ideal for use in CI/CD pipelines or other functional tests.  The `Dockerfile` extends the latest CockroachDB [image](https://hub.docker.com/r/cockroachdb/cockroach), automatically [starts a single node](https://www.cockroachlabs.com/docs/stable/cockroach-start-single-node.html), and can automatically create a database if the environment variable `DATABASE_NAME` is provided.  If the environment variable `MEMORY_SIZE` is provided, CockroachDB will be started with an in-memory store with the given [size](https://www.cockroachlabs.com/docs/stable/cockroach-start-single-node.html#store).  The image is hosted on DockerHub and can be found [here](https://hub.docker.com/repository/docker/timveil/cockroachdb-single-node).\n\nThis project is especially useful when attempting to use CockroachDB as a [Service Container](https://docs.github.com/en/actions/using-containerized-services/about-service-containers) inside GitHub Actions.  Below is a snippet from a GitHub action `yml` file.  Notice the `cockroach` service defined as part of the `cockroachdb` job.  The `DATABASE_NAME` is provided as an `env` value.\n\n```yaml\n  # stuff happens above this...\n  \n  cockroachdb:\n    runs-on: ubuntu-latest\n    services:\n      cockroach: # https://hub.docker.com/repository/docker/timveil/cockroachdb-single-node\n        image: timveil/cockroachdb-single-node:latest\n        env:\n          DATABASE_NAME: benchbase\n        ports:\n          - 26257:26257\n    steps:\n      - name: Checkout repo.\n        uses: actions/checkout@v2\n      - name: Setup JDK 11.\n        uses: actions/setup-java@v1\n        with:\n          java-version: 11\n      - name: Build with Maven.\n        run: mvn -B package --file pom.xml\n  \n  # stuff happens below this...\n```\n\n## Building the Image\n```bash\ndocker build --no-cache -t timveil/cockroachdb-single-node:latest .\n```\n\n## Publishing the Image\n```bash\ndocker push timveil/cockroachdb-single-node:latest\n```\n\n## Running the Image\n```bash\ndocker run -d -it -p 8080:8080 -p 26257:26257 -e \"DATABASE_NAME=test\" -e \"MEMORY_SIZE=.5\" timveil/cockroachdb-single-node:latest\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcockroachlabs-field%2Fcockroachdb-single-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcockroachlabs-field%2Fcockroachdb-single-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcockroachlabs-field%2Fcockroachdb-single-node/lists"}