From 3d81feeeaadcc951eb177e0d346a049c247c00ea Mon Sep 17 00:00:00 2001 From: Robert Coleman Date: Sat, 16 Mar 2024 16:17:46 +1300 Subject: [PATCH] Add additional build tags to Dockerfile --- Dockerfile | 4 +++- docs/docker.md | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5ceb6f7f..0cad071e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM golang:1.19-alpine AS build-env +ARG ADDITIONAL_BUILD_TAGS="" + RUN set -ex && \ apk upgrade --no-cache --available && \ apk add --no-cache build-base @@ -12,7 +14,7 @@ RUN go mod download COPY . ./ RUN mkdir -p /pkg/data && \ cp maddy.conf.docker /pkg/data/maddy.conf && \ - ./build.sh --builddir /tmp --destdir /pkg/ --tags docker build install + ./build.sh --builddir /tmp --destdir /pkg/ --tags "docker ${ADDITIONAL_BUILD_TAGS}" build install FROM alpine:3.18.4 LABEL maintainer="fox.cpp@disroot.org" diff --git a/docs/docker.md b/docs/docker.md index 2898a07b..decb7870 100644 --- a/docs/docker.md +++ b/docs/docker.md @@ -54,6 +54,11 @@ command. One way to it is to run it using `docker exec` instead of `docker run`: docker exec -it container_name_here maddy creds create foxcpp@maddy.test ``` +## Build Tags + +Some Maddy features (such as automatic certificate management via ACME with [a non-default libdns provider](../reference/tls-acme/#dns-providers)) require build tags to be passed to Maddy's `build.sh`, as this is run in the Dockerfile you must compile your own Docker image. Build tags can be set via the docker build argument `ADDITIONAL_BUILD_TAGS` e.g. `docker build --build-arg ADDITIONAL_BUILD_TAGS="libdns_acmedns libdns_route53" -t yourorgname/maddy:yourtagname .`. + + ## TL;DR ```