Skip to content

Commit

Permalink
Merge pull request #690 from rjocoleman/feat/add_tags_to_dockerfile
Browse files Browse the repository at this point in the history
Add additional build tags to Dockerfile
  • Loading branch information
foxcpp authored Jan 24, 2025
2 parents 0b6f34f + 3d81fee commit c4f8a12
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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="[email protected]"
Expand Down
5 changes: 5 additions & 0 deletions docs/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]
```

## 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

```
Expand Down

0 comments on commit c4f8a12

Please sign in to comment.