abiosoft / caddy-docker

Docker container for Caddy
https://hub.docker.com/r/abiosoft/caddy/
MIT License
766 stars 314 forks source link

Convert to Named Volumes #250

Open zuccs opened 4 years ago

zuccs commented 4 years ago

This runs great, but is it possible to convert these into named volumes?

docker run [...] \
    -v $(pwd)/Caddyfile:/etc/Caddyfile \
    -v $HOME/.caddy:/root/.caddy \

Using Portainer as an example:

docker volume create portainer_data
docker run [...] \
    -v portainer_data:/data

This doesn't quite work but for example:

docker volume create caddy_data

# Create file first so Docker doesn't try and make it a folder
touch /var/lib/docker/volumes/caddy_data/Caddyfile

docker run -d \
    --name caddy \
    -v caddy_data:/root/.caddy \
    -v /var/lib/docker/volumes/caddy_data/Caddyfile:/etc/Caddyfile \
    -p 80:80 -p 443:443 \
    abiosoft/caddy

Is this limited due to this missing feature?

Thanks!