abiosoft / caddy-docker

Docker container for Caddy
https://hub.docker.com/r/abiosoft/caddy/
MIT License
766 stars 314 forks source link

Docker-Compose Build Failure #248

Open firedrow opened 4 years ago

firedrow commented 4 years ago

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
MexHigh commented 4 years ago

Same problem here with plugins: cors,realip,expires,cache,ipfilter,jwt,login

Yun-Mao commented 4 years ago

I try to fix it by an unfriendly but useful way. If you need you can try to use mine. caddy_docker

lindelleric commented 4 years ago

I try to fix it by an unfriendly but useful way. If you need you can try to use mine. caddy_docker

What seems to be the issue?

Yun-Mao commented 4 years ago

I try to fix it by an unfriendly but useful way. If you need you can try to use mine. caddy_docker

What seems to be the issue?

I think maybe there are something wrong when getting the link of plugins' packages. I just import the packages manually, so I'm sorry that I don't know the real issue in it.

tdorsey commented 4 years ago

There's more dicussion on this in #223, if it helps anyone. At least part of the issue is the plugins need their full gopath specified at the moment, ie go/github/foo/bar/login instead of login when specifying the plugin argument

happiness9721 commented 4 years ago

I try to fix it by an unfriendly but useful way. If you need you can try to use mine. caddy_docker

thank you guy, u save my day!

talan-z commented 4 years ago

Hi everyone, I'm also experiencing this issue when I try to build with route53 plugin (while adding realip). It fails to find the import path for realip. An thoughts? #223 did not help me...

Yun-Mao commented 4 years ago

Hi everyone, I'm also experiencing this issue when I try to build with route53 plugin (while adding realip). It fails to find the import path for realip. An thoughts? #223 did not help me...

you could try to use caddy_docker

talan-z commented 4 years ago

Thanks, Yu Mao. That's a good workaround. I just managed it to get it to work. But it's only a workaround. I see these issues popping up for several months. Shouldn't this be fixed by now?

Yun-Mao commented 4 years ago

Thanks, Yu Mao. That's a good workaround. I just managed it to get it to work. But it's only a workaround. I see these issues popping up for several months. Shouldn't this be fixed by now?

yeah,I hope the problem can be solved, too

test0103 commented 4 years ago

I have a same problem, but I can't fix it .

Inlustra commented 4 years ago

Also ran into the same problem, I've tried using @Yun-Mao's fork and #223 but neither have worked for me. Unfortunately haven't had the time to dig further into this.