Caddy Web Server

Official Caddy’s image is based on Alpine which is using musl libc⁠ instead of glibc and friends⁠. This image is based on openSUSE Base Container Image, contains glibc and coreutils, and a stripped-down version of Tumbleweed Base Image without Zypper and the RPM package manager.

Containerfile commands:

FROM registry.opensuse.org/opensuse/bci/bci-micro:latest

# Caddy v2.8.4
ENV CADDY_VERSION v2.8.4
RUN set -eux; 
    mkdir -p 
        /config/caddy 
        /data/caddy 
        /etc/caddy 
        /usr/share/caddy
ENV XDG_CONFIG_HOME /config
ENV XDG_DATA_HOME /data

# Caddyfile: https://github.com/caddyserver/dist/raw/509c30cecd3cbc4012f6b1cc88d8f3f000fb06e4/config/Caddyfile
# index.html: https://github.com/caddyserver/dist/raw/509c30cecd3cbc4012f6b1cc88d8f3f000fb06e4/welcome/index.html
# caddy binary: https://github.com/caddyserver/caddy/releases/download/v2.8.4/caddy_2.8.4_linux_amd64.tar.gz
COPY Caddyfile /etc/caddy
COPY index.html /usr/share/caddy
COPY caddy /usr/local/bin

RUN set -eux; 
    chmod +x /usr/local/bin/caddy; 
    caddy version

EXPOSE 80
EXPOSE 443
EXPOSE 443/udp
EXPOSE 2019

WORKDIR /srv

CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]  

Reference:

Changelog:

  • 2024-08-28: initial release, based on openSUSE BCI-micro snapshot #20240826 with binary of Caddy v2.8.4