Portainer Templates logo

Portainer Templates

CockroachDB (stack)

edge

CockroachDB cluster

Configuration

Type
Compose
Source

Template by mikestraney·Source

Notes

Deploys an insecure CockroachDB cluster, please refer to CockroachDB documentation for production deployments.

Services

roach1

Configuration

Image
cockroachdb/cockroach:latest
Command
start --insecure
Ports
8080

Image details

Pulls: 385.6M
User: cockroachdb
Created: Nov 17, 2014
Updated: 4 days ago
Status: active

roachN

Configuration

Image
cockroachdb/cockroach:latest
Command
start --insecure --join=roach1,roachN

Image details

Pulls: 385.6M
User: cockroachdb
Created: Nov 17, 2014
Updated: 4 days ago
Status: active

Installation

  1. Ensure both Docker and Portainer are installed, and up-to-date
  2. Log into your Portainer web UI
  3. Under Settings → App Templates, paste the below URL
  4. Head to Home → App Templates, and the list of apps will show up
  5. 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 demo

Service #1 - roach1

docker run -d --name roach1 \
  -p 8080 \
  cockroachdb/cockroach:latest \
  start --insecure

Service #2 - roachN

docker run -d --name roachN \
  cockroachdb/cockroach:latest \
  start --insecure --join=roach1,roachN

If 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 -d

For 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: 137 means killed, usually out of memory. 126 or 127 means 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 login to 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.

Similar apps