{"id":26499702,"url":"https://github.com/cockroachlabs-field/cockroachdb-remote-client","last_synced_at":"2025-07-26T22:15:05.819Z","repository":{"id":38795237,"uuid":"226348729","full_name":"cockroachlabs-field/cockroachdb-remote-client","owner":"cockroachlabs-field","description":"Docker image used to perform simple tasks against a CockroachDB cluster then disappear","archived":false,"fork":false,"pushed_at":"2023-08-24T16:49:36.000Z","size":228,"stargazers_count":4,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-01-18T08:32:56.476Z","etag":null,"topics":["cockroachdb","docker","docker-compose"],"latest_commit_sha":null,"homepage":"","language":"Java","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":"2019-12-06T14:39:06.000Z","updated_at":"2024-01-18T08:32:56.476Z","dependencies_parsed_at":"2023-02-12T03:30:47.413Z","dependency_job_id":null,"html_url":"https://github.com/cockroachlabs-field/cockroachdb-remote-client","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-remote-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cockroachlabs-field%2Fcockroachdb-remote-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cockroachlabs-field%2Fcockroachdb-remote-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cockroachlabs-field%2Fcockroachdb-remote-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cockroachlabs-field","download_url":"https://codeload.github.com/cockroachlabs-field/cockroachdb-remote-client/tar.gz/refs/heads/master","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","docker-compose"],"created_at":"2025-03-20T15:18:49.028Z","updated_at":"2025-03-20T15:18:49.825Z","avatar_url":"https://github.com/cockroachlabs-field.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CockroachDB Remote Client\nDocker image used to perform simple tasks against a CockroachDB cluster then disappear.  For example, this can be useful for creating a database or setting configuration parameters, especially when used in Kubernetes or Docker Compose.  The following `docker-compose.yml` snippet highlights how it may be used, specifically the `crdb-init` service. \n\n```yaml\nservices:\n\n  crdb-0:\n    ...\n\n  crdb-1:\n    ...\n\n  crdb-2:\n    ...\n\n  lb:\n    container_name: lb\n    hostname: lb\n    image: timveil/dynamic-haproxy:latest\n    ports:\n      - \"26257:26257\"\n      - \"8080:8080\"\n      - \"8081:8081\"\n    environment:\n      - NODES=crdb-0 crdb-1 crdb-2\n    depends_on:\n      - crdb-0\n      - crdb-1\n      - crdb-2\n\n  crdb-init:\n    container_name: crdb-init\n    hostname: crdb-init\n    image: timveil/cockroachdb-remote-client:latest\n    environment:\n      - COCKROACH_HOST=crdb-0:26257\n      - COCKROACH_INSECURE=true\n      - DATABASE_NAME=test\n    depends_on:\n      - lb\n```\n\nThe following `environment` variables are supported.  See https://www.cockroachlabs.com/docs/stable/use-the-built-in-sql-client.html#client-connection for more details.\n* `COCKROACH_HOST` - __Required__. CockroachDB host and port number to connect to `\u003chost\u003e:\u003cport\u003e`.  If port not included you must specify `COCKROACH_PORT`.\n* `COCKROACH_USER` - __Required__. CockroachDB user that will own the remote client session.\n* `COCKROACH_PORT` - CockroachDB port if not specified by `COCKROACH_HOST`.\n* `COCKROACH_INSECURE` - Use an insecure connection.  Value must be `true` or `false`.\n* `COCKROACH_CERTS_DIR` - The path to the certificate directory containing the CA and client certificates and client key.\n* `DATABASE_NAME` - Name of database to create.\n* `DATABASE_USER` - Name of new database user to create.  __Important__, this user will be created as a CockroachDB `admin`.\n* `DATABASE_PASSWORD` - Password for `DATABASE_USER`.  If not provided the password will be set to `NULL` preventing the user from using [password based authentication](https://www.cockroachlabs.com/docs/v20.2/create-user.html#prevent-a-user-from-using-password-authentication).\n* `COCKROACH_ORG` - The value of the `cluster.organization` setting.\n* `COCKROACH_LICENSE_KEY` - The value of the `enterprise.license` setting.\n* `COCKROACH_INIT` - Initializes the CockroachDB cluster with the `cockroach init` command.\n\n## Building the Image\n```bash\ndocker build --no-cache -t timveil/cockroachdb-remote-client:latest .\n```\n\n## Publishing the Image\n```bash\ndocker push timveil/cockroachdb-remote-client:latest\n```\n\n## Running the Image\n```bash\ndocker run -it timveil/cockroachdb-remote-client:latest\n```\n\nrunning the image with environment variables\n```bash\ndocker run \\\n    --env COCKROACH_HOST=localhost:26257 \\\n    --env COCKROACH_INSECURE=true \\\n    --env DATABASE_NAME=test \\\n    --env COCKROACH_INIT=true \\\n    -it timveil/cockroachdb-remote-client:latest\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcockroachlabs-field%2Fcockroachdb-remote-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcockroachlabs-field%2Fcockroachdb-remote-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcockroachlabs-field%2Fcockroachdb-remote-client/lists"}