5. What I already tried:
I was originally using the alpine image (before the official image used versioned tags) from a month or so ago. When this issue happened earlier this week I switched to the most recent tagged image, v2.0.0-beta.17 and the issue happened again a couple days later.
To fix it the first time, I force removed the image and then had to reboot the server because port 443 was still allocated. This time, I rebooted the server without force killing the image. docker-compose ps then showed the reverse-proxy container in a state of Exit 255. I ran docker-compose restart reverse-proxy and the site came back up.
6. Links to relevant resources:
I found an issue on moby/moby that sounds similar.
At a glance, I think your volume paths are outdated, they were changed in the official Docker image recently to /data and /config for simplicity.
As for the actual issues you’re encountering, I really don’t have a clue what’s going on. It does sound like it might be more of an issue with Docker itself than Caddy.
As for your logs and the TLS handshake errors, I’m pretty sure that’s due to clients that don’t support SNI attempting to connect. This results in Caddy not knowing which certificate to serve, so it quits.
A workaround for this would be to use the default_sni global option (which may have been added in beta 18? I don’t remember what version that was added, sorry) to force Caddy to pick a domain so it can serve a certificate. (@matt hopefully I’m not spewing lies here?)
francislavoie:
As for your logs and the TLS handshake errors, I’m pretty sure that’s due to clients that don’t support SNI attempting to connect. This results in Caddy not knowing which certificate to serve, so it quits.
The “no certificate available for” errors are indeed because the client didn’t give a (recognized) ServerName in the handshake. But Caddy will never quit because of that.
Honestly all those TLS handshake errors look benign/normal to me – spammy/bad clients most likely, and really nothing to do with the container problem.
wilson29thid:
I’ll try updating the volume paths. Was this change announced anywhere? The caddy docs still seem to point to the original locations, unless I’ve misread them, and the docker readme doesn’t mention them at all.
Not exactly. It’s still in beta, so we were less worried about making breaking changes. It initially was done here Adding data and config volumes by hairyhenderson · Pull Request #39 · caddyserver/caddy-docker · GitHub and later changed again in Fix VOLUME instructions to point to right locations by hairyhenderson · Pull Request #48 · caddyserver/caddy-docker · GitHub (the original change had a mistake).