Skip to content

Commit

Permalink
Merge pull request #24 from szaimen/enh/noid/improve-building
Browse files Browse the repository at this point in the history
do not build xcaddy from source in order to speed up the building
  • Loading branch information
szaimen authored Feb 9, 2024
2 parents 6095617 + f9ca47e commit fc89b02
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 21 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/caddy-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@ jobs:
run: |
set -x
# Xcaddy
xcaddy_version="$(
git ls-remote https://github.com/caddyserver/xcaddy v* \
| cut -d/ -f3 \
| sort -V \
| grep -E "^v[0-9\.]+$" \
| tail -1
)"
sed -i "s|^ENV XCADDY_VERSION.*$|ENV XCADDY_VERSION $xcaddy_version|" ./Dockerfile
# caddy_hash
caddy_hash="$(
git ls-remote https://github.com/porech/caddy-maxmind-geolocation master \
Expand Down
14 changes: 3 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
FROM caddy:2.7.6-builder-alpine AS builder

FROM golang:1.22.0-alpine3.18 as go

ENV XCADDY_VERSION v0.3.5
ENV CADDY_HASH 29233e285b83dfa070d1f6889c021cb32c161b89

# hadolint ignore=DL3018
RUN set -ex; \
apk add --no-cache \
build-base \
git; \
go install github.com/caddyserver/xcaddy/cmd/xcaddy@"$XCADDY_VERSION"; \
chmod +x /go/bin/xcaddy; \
/go/bin/xcaddy build --with github.com/porech/caddy-maxmind-geolocation@"$CADDY_HASH"
xcaddy build --with github.com/porech/caddy-maxmind-geolocation@"$CADDY_HASH"

FROM alpine:3.19.1

Expand All @@ -31,7 +23,7 @@ RUN set -ex; \

VOLUME /data

COPY --from=go /go/caddy /usr/local/bin/caddy
COPY --from=builder /usr/bin/caddy /usr/local/bin/caddy
COPY --chmod=775 start.sh /start.sh
COPY --chown=33:33 Caddyfile /Caddyfile

Expand Down

0 comments on commit fc89b02

Please sign in to comment.