Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set up in docker compose? #230

Open
easyjoh opened this issue Jan 28, 2024 · 2 comments
Open

How to set up in docker compose? #230

easyjoh opened this issue Jan 28, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@easyjoh
Copy link

easyjoh commented Jan 28, 2024

I am trying to set up zeronsd in docker using the docker compose. Cannot find documentation on how to do it.

Also I would like to not expose the zeronsd to any other on service on the server. Do I need the docker container to join the network if the host has already joined the network?

@adobito
Copy link

adobito commented Feb 4, 2024

With the current released docker image you won't be able to do it. You'll have to build you own image so you can set the ZEROTIER_LOCAL_URL parameter.

start --domain example.com --local-url http://zerotier-one:9993 <networkId>

EDIT: FInally got mine to work, had to go to the zerotier-one local.conf file and set the subnet for the docker network under "allowManagementFrom".

This is is my docker-compose file:

services:
  zeronsd:
    image: <yourBuiltImage>
    container_name: zeronsd
    hostname: zeronsd
    restart: unless-stopped
    environment:
      - ZEROTIER_CENTRAL_TOKEN=${ZEROTIER_CENTRAL_TOKEN}
    volumes:
      - /var/lib/zerotier-docker:/var/lib/zerotier-one:ro
    command: ["start", "--domain", "${ZERONSD_DOMAIN}","--local-url", "${ZEROTIER_LOCAL_URL}", "${ZEROTIER_NETWORK_ID}"]
    networks:
      - zerotier-net
  zerotier-one:
    image: zyclonite/zerotier
    container_name: zerotier-one
    hostname: zerotier-one
    devices:
      - "/dev/net/tun"
    cap_add:
      - NET_ADMIN
      - SYS_ADMIN
    volumes:
      - /var/lib/zerotier-docker:/var/lib/zerotier-one
    networks:
      - zerotier-net
networks:
  zerotier-net:
    driver: bridge

You're going to need to set the following 4 env vars:

  • ZEROTIER_CENTRAL_TOKEN
  • ZEROTIER_LOCAL_URL
  • ZERONSD_DOMAIN
  • ZEROTIER_NETWORK_ID

@johnthq
Copy link

johnthq commented Jul 20, 2024

anyone having issues building images? i would like to setup zeronsd like this.

@laduke laduke added the documentation Improvements or additions to documentation label Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants