docs icon indicating copy to clipboard operation
docs copied to clipboard

Feedback: Deploy a Local Cluster in Docker (Insecure)

Open montyx00 opened this issue 8 months ago • 0 comments

Page: https://cockroachlabs.com/docs/v25.1/start-a-local-cluster-in-docker-mac.html

What is the reason for your feedback?

[ ] Missing the information I need

[ ] Too complicated

[ ] Out of date

[ X] Something is broken

[ ] Other

Additional details

I try to create a docker-compose.yaml, which deploy a single node with certs and create a database with a db owner username and pass. The docker-compose.yaml content:

services:
  cockroachdb:
    image: cockroachdb/cockroach:latest
    container_name: cockroachdb
    command: start-single-node --certs-dir=/certs --advertise-addr=cockroachdb --http-addr=0.0.0.0
    volumes:
      - ./certs:/certs
      - ./cockroach-data:/cockroach/cockroach-data
    networks:
      - cockroachdb_net
    environment:
      - COCKROACH_DATABASE="dbnametest"
      - COCKROACH_USER="dbusertest"
      - COCKROACH_PASSWORD="dbpasstest"
    ports:
      - "26257:26257"
      - "8080:8080"

networks:
  cockroachdb_net:
    name: cockroachdb_net

This is described in the document in the Start a single node chapter: https://www.cockroachlabs.com/docs/stable/start-a-local-cluster-in-docker-mac#start-a-single-node-cluster

After that I get an error message before the container quits with error code 1:

cockroachdb  | Connecting to server "cockroachdb:26257" as user "root".
cockroachdb  | ERROR: password authentication failed for user root
cockroachdb  | SQLSTATE: 28P01

I can set root username and password with the following settings from an old stackoverflow topic:

db_user: root
db_password: 123

In that case the COCKROACH_USER cannot login to the web UI. Exactly there is no user which can use the web UI. Please clarify which method works and correct the documentation. Thanks a lot!

montyx00 avatar Mar 27 '25 18:03 montyx00