abiosoft / abiosoft/caddy-docker

Docker-Compose Build Failure

Open
#248 12 comments 4 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
787
Forks
303
PR merge metrics
No merged PRs in 30d

Description

This may be related to Issue #247 but I wanted to post based on how I am setup.

I'm using Docker-Compose to attempt to build caddy and it keeps failing. I have the same configuration running on a different system, but I haven't rebuilt in a while so it worked back when I originally got it setup.

```
version: '3.4'
services:
caddy:
build:
context: github.com/abiosoft/caddy-docker.git
args:
plugins: cgi,cors,webdav
container_name: "caddy"
environment:
- ACME_AGREE=true
ports:
- "80:80"
- "443:443"
volumes:
- /mnt/data/disk2/caddy/Caddyfile:/etc/Caddyfile:ro
- /mnt/data/disk2/caddy/www:/var/www:rw
- /mnt/data/disk2/caddy/cert:/root/.caddy:rw
- /mnt/data/disk2/caddy/logs:/root/logs:rw
restart: always
```

When I run my `docker-compose up -d` I get through most of the stages until it goes to build caddy.

```
starting stage: building caddy
go: downloading gopkg.in/natefinch/lumberjack.v2 v2.0.0
go: downloading github.com/hashicorp/go-syslog v1.0.0
go: downloading github.com/jimstudt/http-authentication v0.0.0-20140401203705-3eca13d6893a
go: downloading gopkg.in/yaml.v2 v2.2.2
go: downloading github.com/gorilla/websocket v1.4.0
go: downloading github.com/dustin/go-humanize v1.0.0
go: downloading github.com/russross/blackfriday v0.0.0-20170610170232-067529f716f4
go: downloading github.com/naoina/toml v0.1.1
go: downloading github.com/lucas-clemente/quic-go v0.10.2
go: extracting github.com/jimstudt/http-authentication v0.0.0-20140401203705-3eca13d6893a
go: extracting github.com/hashicorp/go-syslog v1.0.0
go: extracting github.com/russross/blackfriday v0.0.0-20170610170232-067529f716f4
go: extracting gopkg.in/yaml.v2 v2.2.2
go: extracting github.com/naoina/toml v0.1.1
go: extracting gopkg.in/natefinch/lumberjack.v2 v2.0.0
go: extracting github.com/gorilla/websocket v1.4.0
go: downloading github.com/naoina/go-stringutil v0.1.0
go: extracting github.com/dustin/go-humanize v1.0.0
go: extracting github.com/lucas-clemente/quic-go v0.10.2
go: extracting github.com/naoina/go-stringutil v0.1.0
go: downloading github.com/bifurcation/mint v0.0.0-20180715133206-93c51c6ce115
go: downloading github.com/cheekybits/genny v0.0.0-20170328200008-9127e812e1e9
go: downloading github.com/lucas-clemente/aes12 v0.0.0-20171027163421-cd47fb39b79f
go: downloading github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47
go: downloading github.com/lucas-clemente/quic-go-certificates v0.0.0-20160823095156-d2f86524cced
go: extracting github.com/cheekybits/genny v0.0.0-20170328200008-9127e812e1e9
go: extracting github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47
go: extracting github.com/lucas-clemente/quic-go-certificates v0.0.0-20160823095156-d2f86524cced
go: extracting github.com/lucas-clemente/aes12 v0.0.0-20171027163421-cd47fb39b79f
go: extracting github.com/bifurcation/mint v0.0.0-20180715133206-93c51c6ce115
can't load package: package caddy:
cgi.go:2:10: invalid import path: ""
error at 'building caddy'
ERROR: Service 'caddy' failed to build: The command '/bin/sh -c VERSION=${version} PLUGINS=${plugins} ENABLE_TELEMETRY=${enable_telemetry} /bin/sh /usr/bin/builder.sh' returned a non-zero code: 1

```

Contributor guide

No contributing guide indexed for this repository

Research direction

The error occurs during the Docker build when compiling Caddy with plugins, specifically an invalid import path in cgi.go. Examine the builder.sh script and the Dockerfile to understand how plugins are integrated. Check the plugin source code for import path issues, and test building with the specified plugins locally to reproduce the failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose, go, shell
Domain
build-system, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.