{"id":17343672,"url":"https://github.com/gma/caddy-webdav-container","last_synced_at":"2026-05-02T14:38:16.608Z","repository":{"id":218101757,"uuid":"745096642","full_name":"gma/caddy-webdav-container","owner":"gma","description":"Dockerfile to build Caddy image with WebDAV support","archived":false,"fork":false,"pushed_at":"2024-09-07T13:01:56.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-01T14:31:24.029Z","etag":null,"topics":["caddy","caddyserver","docker-image","dockerfile","webdav","webdav-server"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gma.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-18T16:30:19.000Z","updated_at":"2024-09-07T13:01:59.000Z","dependencies_parsed_at":"2024-12-06T01:40:55.925Z","dependency_job_id":"55151860-8abe-4bc0-ba98-2d81a5e59dc8","html_url":"https://github.com/gma/caddy-webdav-container","commit_stats":null,"previous_names":["gma/caddy-webdav-container"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gma%2Fcaddy-webdav-container","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gma%2Fcaddy-webdav-container/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gma%2Fcaddy-webdav-container/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gma%2Fcaddy-webdav-container/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gma","download_url":"https://codeload.github.com/gma/caddy-webdav-container/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245820795,"owners_count":20677916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["caddy","caddyserver","docker-image","dockerfile","webdav","webdav-server"],"created_at":"2024-10-15T16:10:00.019Z","updated_at":"2026-05-02T14:38:16.570Z","avatar_url":"https://github.com/gma.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"caddy-webdav-container\n======================\n\nThis is a simple repository, containing docs and scripts that are useful\nfor building container images for running the [Caddy] web server with\n[support for WebDAV].\n\nIf you'd like to build an image that supports a single architecture, you\ncan use the [Dockerfile] in this repository to build yourself one.\n\nYou might be wondering why I haven't pushed the image up to Docker Hub\nso that all you need to do is pull it down yourself. In a word, the\nanswer is \"security\". We shouldn't use random Docker images that we find\non Docker Hub; you've no idea what might be in it, or what might sneak\ninto it in future.\n\nI'm not going to use somebody else's, and neither should you. That\ndoesn't mean that I can't do a load of the work for you though. Take a\nlook at the [Dockerfile] and you'll see that it's very short and easy to\nunderstand. All it does is use the official Caddy builder image to\ncompile a version of Caddy with the [mholt/caddy-webdav] module included.\n\nTo build it on your machine, you can just clone this repository and then\nrun:\n\n    docker build --build-arg VERSION=2.8.4 \\\n        -t caddy-webdav:2.8.4 \\\n        -t caddy-webdav:latest \\\n        .\n\nNote the `VERSION` argument, that specifies which version of Caddy we're\ngoing to build. 2.8.4 is the latest at the time of writing; see the\n[official Caddy image page] for a list of the latest available versions.\n\n[Caddy]: https://caddyserver.com\n[official Caddy image page]: https://hub.docker.com/_/caddy\n[support for WebDAV]: https://github.com/mholt/caddy-webdav\n[mholt/caddy-webdav]: https://github.com/mholt/caddy-webdav\n[Dockerfile]: ./Dockerfile\n\nGetting setup for multi-platform images\n---------------------------------------\n\nIf all you need is an image that you can install locally (or on a\nmachine that's running the same architecture), the above docs and build\ncommand are probably all you need.\n\nI run Caddy on a variety of hardware (e.g. x86 machines and low powered\nARM devices). So I want a [multi-platform image] that supports\n`linux/amd64` and `linux/arm/v7` architectures, that I can publish on my\nown private Docker Registry.\n\nThe rest of the files in this repository (and the rest of this README)\nare here to make building those multi-platform images straightforward.\n\nTo build Caddy for multiple architectures we need to run the build\nprocess inside a virtual machine. Docker's buildkit can take care of\nthis for us, via it's [docker-container driver]. To use it we need to\ncreate a new builder, and then use it when we build the Caddy image.\n\nBut there's one more thing I should explain first…\n\nAt the end of the multi-platform build, Docker can push our completed\nimages to a registry for us. This is behaviour I need; I push them to a\nprivately hosted registry that's secured with a self-signed Certificate\nAuthority (CA) certificate. Unfortunately, the build container doesn't\nrecognise my registry's self-signed certificate, so Docker can't push my\nCaddy images to it without a bit of help.\n\nTo workaround that problem I've made a slightly modified build\ncontainer, that's created using [Dockerfile.buildkit].\n\nThat's a lot of explanation, in practice it's quite straightforward. The\nfirst time I build a multi-platform image on my workstation, I start by\ncreating my custom build container:\n\n    cp ../path/to/my-registry-cert.crt ./registry.crt\n    docker build -f Dockerfile.buildkit -t buildkit-cert:latest .\n\nThen I use my new `buildkit-cert:latest` image to setup builder so it\ncan handle a multi-platform build (i.e. a builder that uses the\n[docker-container driver]):\n\n    docker buildx create --name container \\\n        --driver=docker-container \\\n        --driver-opt=image=buildkit-cert:latest\n\nIf you're following along, and you don't need to push to a registry that\nhas an unrecognised certificate, you don't need to build the custom\nimage, or pass the `--driver-opt` switch to `docker buildx create`.\n\nNote the name of the builder that we've created is set to \"container\".\nThat's not critical, but beware that the `build.sh` script that I use to\nbuild the Caddy image (below) has that name hard coded within it.\n\nRun `docker buildx ls` to list your available builders and their drivers\n(you should also have one called \"default\").\n\n[multi-platform image]: https://docs.docker.com/build/building/multi-platform/\n[docker-container driver]: https://docs.docker.com/build/drivers/docker-container/\n[Dockerfile.buildkit]: ./Dockerfile.buildkit\n\nBuilding a multi-platform caddy image\n-------------------------------------\n\nAfter all that prep, you're ready to build a Caddy image with webdav\nsupport, that'll run on multiple CPU architectures.\n\nTo ensure that I do this consistently every time, I wrote the `build.sh`\nscript. It takes up to 3 arguments:\n\n    ./build.sh \u003cversion\u003e [hostname[:port]] [namespace]\n\nAt a minimum, you have to specify the version of Caddy that you'd like\nto use. You can use any of the tags on the [official Caddy image page].\n\ne.g.\n\n    ./build.sh 2.8.4\n\nYou can also (optionally) specify a namespace and a registry, which will\nbe used in your tag.\n\nThe hostname defaults to \"docker.io\" and the namespace defaults to\n\"library\".\n\nBy default it builds an image that supports three architectures:\n`linux/amd64`, `linux/arm64`, and `linux/arm/v7`. You can override that\nbehaviour by setting the `PLATFORM` environment variable:\n\n    PLATFORM=\"linux/amd64,linux/arm64\" ./build.sh 2.8.4\n\nSo, to summarise, if you were to run it like this (as I do):\n\n    ./build.sh 2.8.4 registry.local\n\n…then you'd:\n\n- use your new docker-container driver to…\n- build a Caddy 2.8.4 image with WebDAV support compiled in,\n- named \"registry.local/library/caddy-webdav\" and tagged with \"2.8.4\", and\n- Docker would push it to `registry.local`\n\nYou might be wondering why it pushes automatically. It's because a\nmulti-platform image can't be loaded into your local image store, and if\nwe didn't push it then at the end of the build process the images would\n[only be available][issue] in Docker's build cache. You wouldn't be able to\ncreate containers from them, for example.\n\nAlso, because I always push a new image to my local registry, it just\nmakes sense for me to push them automatically.\n\n[issue]: https://github.com/docker/buildx/issues/59\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgma%2Fcaddy-webdav-container","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgma%2Fcaddy-webdav-container","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgma%2Fcaddy-webdav-container/lists"}