CockroachDB (stack)
CockroachDB cluster
Template by mikestraney·Source
Notes
Services
roach1
Configuration
Imagecockroachdb/cockroach:lateststart --insecure8080Image details
roachN
Configuration
Imagecockroachdb/cockroach:lateststart --insecure --join=roach1,roachNImage details
Installation
- Ensure both Docker and Portainer are installed, and up-to-date
- Log into your Portainer web UI
- Under Settings → App Templates, paste the below URL
- Head to Home → App Templates, and the list of apps will show up
- Select the app you wish to deploy, fill in any config options, and hit Deploy
Template Import URL
https://raw.githubusercontent.com/Lissy93/portainer-templates/main/templates.json
Show Me
Service #1 - roach1
docker run -d --name roach1 \
-p 8080 \
cockroachdb/cockroach:latest \
start --insecureService #2 - roachN
docker run -d --name roachN \
cockroachdb/cockroach:latest \
start --insecure --join=roach1,roachNIf the stack expects env vars, set them or add them to a .env file first.
version: '3'
services:
roach1:
image: cockroachdb/cockroach:latest
command: "start --insecure"
deploy:
replicas: 1
ports:
- 8080
roachN:
image: cockroachdb/cockroach:latest
command: "start --insecure --join=roach1,roachN"
deploy:
mode: global
Or, use the original compose file, straight from the template repo. Deploy with:
git clone https://github.com/mikestraney/portainer-templates
cd portainer-templates
docker compose -f stacks/cockroachdb/edge/docker-stack.yml up -dFor more installation options, see the Documentation in our GitHub repo
Container Documentation
roach1 Documentation
CockroachDB — Distributed SQL database for always-on customer experiences
roachN Documentation
CockroachDB — Distributed SQL database for always-on customer experiences
Check the logs first
Nine times out of ten the logs tell you exactly what went wrong.
- In Portainer, go to Containers, click the container, then Logs. Or run
docker logs <container> - Exit codes help too:
137means killed, usually out of memory.126or127means the command inside the image is broken.
Image won't pull
Test the pull directly on the host: docker pull cockroachdb/cockroach:latest
- "manifest unknown" means the tag no longer exists. This template uses
latest, so try pinning a specific version instead. - "toomanyrequests" is the Docker Hub rate limit. Log in with
docker loginto raise it. - "no space left on device" means a full disk. Reclaim space with
docker system prune
"exec format error"
This means the image was built for a different CPU architecture than your server.
- Check yours with
uname -m: x86_64 is amd64, aarch64 is arm64. Raspberry Pi and other ARM boards are the usual culprits.
Stack won't deploy
Compose stacks fail fast on small mistakes, and Portainer shows the reason just above the editor.
- YAML only accepts spaces for indentation, a single tab breaks the whole file.
Raise an issue
Found something which isn't working as it should? Here's how to report it.
- Bug within the app: Open an issue within roach1's repo
- Template not working: Open an issue on mikestraney/portainer-templates
- This website not working: Open an issue on lissy93/portainer-templates