Skip to content

Instantly share code, notes, and snippets.

@ttys3
Forked from garthk/README.md
Created September 3, 2019 17:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ttys3/3033681153841e3ebef64416e8b1d4ab to your computer and use it in GitHub Desktop.
Save ttys3/3033681153841e3ebef64416e8b1d4ab to your computer and use it in GitHub Desktop.
Fixing Docker on QNAP
$ export DOCKER_HOST=tcp://fnord.local:2376 DOCKER_TLS_VERIFY=1
$ docker ps
An error occurred trying to connect: Get https://fnord.local:2376/v1.21/containers/json: x509: certificate is valid for fnord, 192.168.23.23 , localhost, not fnord.local
$ ssh admin@fnord.local
# /sbin/setcfg global realm local -f /etc/config/smb.conf
# /etc/init.d/network.sh restart
# hostname -f
fnord.local
# cd $(dirname $(readlink /etc/init.d/container-station.sh))
# /etc/init.d/container-station.sh stop
# rm etc/docker/tls/*
# /etc/init.d/container-station.sh start
# cat etc/docker/tls/hostnames
fnord,192.168.23.23 , localhost
# echo AARGH

Hand-edit script/gen-docker-certs.sh so it sets:

CERTHOSTNAMES="$(hostname -f),$(hostname -s),$(hostname -i)"

Then repeat a few steps:

# /etc/init.d/container-station.sh stop
# rm etc/docker/tls/*
# /etc/init.d/container-station.sh start
# cat etc/docker/tls/hostnames
fnord.local,fnord,192.168.23.23 , localhost,127.0.0.1

Better. Not sure where the 127.0.0.1 came from, but better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment