juanfont / headscale

An open source, self-hosted implementation of the Tailscale control server
BSD 3-Clause "New" or "Revised" License
20.77k stars 1.15k forks source link

Published docker images not works #266

Closed artemklevtsov closed 2 years ago

artemklevtsov commented 2 years ago

Issue description

Can't get it works with docker images from the Docker Hub.

To Reproduce

$ mkdir config
$ cat  <<EOL > config/config.yaml
server_url: https://example.com
listen_addr: 0.0.0.0:8080
private_key_path: /var/lib/headscale/private.key
unix_socket: /var/run/headscale.sock
ip_prefix: 100.64.0.0/10
log_level: info
disable_check_updates: false
ephemeral_node_inactivity_timeout: 30m
db_type: sqlite3
db_path: /var/lib/headscale/db.sqlite
derp:
  urls:
    - https://controlplane.tailscale.com/derpmap/default
  auto_update_enabled: true
  update_frequency: 24h
dns_config:
  nameservers:
    - 1.1.1.1
    - 8.8.8.8
  domains: []
  magic_dns: false
  #base_domain: unikum.lan
EOL
$ mkdir data
$ touch data/db.sqlite
$ docker run --rm -p 8080:8080 -v $PWD/config:/etc/headscale -v $PWD/data:/var/lib/headscale -e PUID=1000 -e PGID=1000 headscale/headscale:0.11.0 headscale serve
2022/01/08 16:04:03 Error initializing: open /var/lib/headscale/private.key: no such file or directory
$ docker run --rm -p 8080:8080 -v $PWD/config:/etc/headscale -v $PWD/data:/var/lib/headscale -e PUID=1000 -e PGID=1000 jauderho/headscale:v0.12.1 serve
2022-01-08T16:04:41Z INF No private key file at path, creating... path=/var/lib/headscale/private.key
2022/01/08 16:04:41 Error initializing: Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub

Add info

$ ocker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.7.1-docker)
  compose: Docker Compose (Docker Inc., 2.2.3)

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 16
 Server Version: 20.10.12
 Storage Driver: overlay2
  Backing Filesystem: btrfs
  Supports d_type: true
  Native Overlay Diff: false
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 1407cab509ff0d96baa4f0eb6ff9980270e6e620.m
 runc version: v1.0.3-0-gf46b6ba2
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.15.13-zen1-1-zen
 Operating System: Arch Linux
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 62.79GiB
 Name: unikum-desktop
 ID: IOSH:44GF:6UH2:UYBK:HFGA:GNSF:ZKE6:WLBT:MUEE:ON2A:ITAM:3HWD
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Username: artemklevtsov
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
 Default Address Pools:
   Base: 172.240.0.0/16, Size: 24
artemklevtsov commented 2 years ago

Seems should be fixed in #253.