1. The problem I’m having:
Can’t built xcaddy with plugin via docker.
I need this for running in AWS EC2 with dynamoDb.
2. Error messages and/or full log output:
1746.3 get "bazil.org/fuse": found meta tag vcs.metaImport{Prefix:"bazil.org/fuse", VCS:"git", RepoRoot:"https://github.com/bazil/fuse"} at //bazil.org/fuse?go-get=1
1747.0 get "cloud.google.com/go/firestore": found meta tag vcs.metaImport{Prefix:"cloud.google.com/go", VCS:"git", RepoRoot:"https://github.com/googleapis/google-cloud-go"} at //cloud.google.com/go/firestore?go-get=1
1747.0 get "cloud.google.com/go/firestore": verifying non-authoritative meta tag
1747.2 get "golang.org/x/xerrors": found meta tag vcs.metaImport{Prefix:"golang.org/x/xerrors", VCS:"git", RepoRoot:"https://go.googlesource.com/xerrors"} at //golang.org/x/xerrors?go-get=1
1749.1 get "golang.org/x/exp": found meta tag vcs.metaImport{Prefix:"golang.org/x/exp", VCS:"git", RepoRoot:"https://go.googlesource.com/exp"} at //golang.org/x/exp?go-get=1
1764.6 go: github.com/caddyserver/caddy/v2@v2.7.6 requires
1764.6 github.com/go-kit/kit@v0.10.0 requires
1764.6 sourcegraph.com/sourcegraph/appdash@v0.0.0-20190731080439-ebfcffb1b5c0: unrecognized import path "sourcegraph.com/sourcegraph/appdash": reading https://sourcegraph.com/sourcegraph/appdash?go-get=1: 404 Not Found
1764.6 2023/12/27 09:48:33 [FATAL] exit status 1
------
Dockerfile:12
--------------------
11 |
12 | >>> RUN mkdir -p /tmp/caddy-build && \
13 | >>> GOOS=${OS} xcaddy build ${CADDY_VERSION} --with github.com/ss098/certmagic-s3 \
14 | >>> --with github.com/silinternational/certmagic-storage-dynamodb/v3 \
15 | >>> --output /tmp/caddy-build/aws_caddy_${CADDY_VERSION}_${OS}
--------------------
ERROR: failed to solve: process "/bin/sh -c mkdir -p /tmp/caddy-build && GOOS=${OS} xcaddy build ${CADDY_VERSION} --with github.com/ss098/certmagic-s3 --with github.com/silinternational/certmagic-storage-dynamodb/v3 --output /tmp/caddy-build/aws_caddy_${CADDY_VERSION}_${OS}" did not complete successfully: exit code: 1
3. Caddy version:
v2.7.6
4. How I installed and ran Caddy:
a. System environment:
b. Command:
#!/usr/bin/env bash
set -e
# Set OS (first script argument)
OS=${1:-linux}
# Set Caddy version (second script argument)
CADDY_VERSION=${2:-v2.7.6}
# Create release folders
mkdir -p $PWD/releases $PWD/temp_release
# Run build
docker build --build-arg OS=$OS --build-arg CADDY_VERSION=$CADDY_VERSION -t custom-caddy-build .
# Copy release from image to temporary folder
docker run -v $PWD/temp_release:/opt/mount --rm -ti custom-caddy-build bash -c "cp /tmp/caddy-build/* /opt/mount/"
c. Service/unit/compose file:
FROM amazonlinux:2023
ARG CADDY_VERSION=v2.7.6
ARG OS=linux
# Install dependencies
RUN yum update -y && \
yum install golang -y
RUN GOBIN=/usr/local/bin/ go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
RUN mkdir -p /tmp/caddy-build && \
GOOS=${OS} xcaddy build ${CADDY_VERSION} --with github.com/ss098/certmagic-s3 \
--with github.com/silinternational/certmagic-storage-dynamodb/v3 \
--output /tmp/caddy-build/aws_caddy_${CADDY_VERSION}_${OS}