abiosoft / caddy-docker

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

Master is broken #81

Closed lorddaedra closed 6 years ago

lorddaedra commented 6 years ago

Master is broken (for more than 20 days based on date of latest commit)... It's not good...

➜  caddy-docker git:(master) docker build -t "test" .
Sending build context to Docker daemon  152.6kB
Step 1/18 : FROM abiosoft/caddy:builder as builder
 ---> 44e486110cd5
Step 2/18 : ARG version="0.10.10"
 ---> Using cache
 ---> 4f1fcb3d8e7b
Step 3/18 : ARG plugins="git"
 ---> Using cache
 ---> 08f5b9ba9587
Step 4/18 : RUN VERSION=${version} PLUGINS=${plugins} /bin/sh /usr/bin/builder.sh
 ---> Running in 4bb5f7926903
container_linux.go:265: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory"
oci runtime error: container_linux.go:265: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory"

➜  caddy-docker git:(master) git branch -a
lorddaedra commented 6 years ago
macOS: version 10.13.2 (build: 17C88)
logs: /tmp/2B9583F2-718B-4906-81F1-428E55742AAB/20171218-094631.tar.gz
[OK]     db.git
[OK]     vmnetd
[OK]     dns
[OK]     driver.amd64-linux
[OK]     virtualization VT-X
[OK]     app
[OK]     moby
[OK]     system
[OK]     moby-syslog
[OK]     db
[OK]     env
[OK]     virtualization kern.hv_support
[OK]     slirp
[OK]     osxfs
[OK]     moby-console
[OK]     logs
[OK]     docker-cli
[OK]     menubar
[OK]     disk
lorddaedra commented 6 years ago
Version 17.09.1-ce-mac42 (21090)
Channel: stable
3176a6af01
abiosoft commented 6 years ago

It built successfully on Linux, I'll get hold of my Mac in an hour or two and try to reproduce this.

abiosoft commented 6 years ago

I can't seem to reproduce this. Cloning master and running docker build -t test . was successful on my Mac using Docker community edition

Version 17.09.1-ce-mac42 (21090)
Channel: stable
3176a6af01

Could there be something wrong with your setup ? Mind trying to build on another machine/server ? I will reopen this when we are able to ascertain there is indeed an issue.

abiosoft commented 6 years ago

Also trying building with --no-cache flag.

lorddaedra commented 6 years ago

@abiosoft I still can't build master on my Mac but I can build 0.10.10

➜  caddy-docker git:(master) docker build -t test --no-cache .
Sending build context to Docker daemon  159.2kB
Step 1/18 : FROM abiosoft/caddy:builder as builder
 ---> 44e486110cd5
Step 2/18 : ARG version="0.10.10"
 ---> Running in 09ddea765628
 ---> d95bc4c9b00e
Removing intermediate container 09ddea765628
Step 3/18 : ARG plugins="git"
 ---> Running in 2767757ad394
 ---> 83ee753d8ff4
Removing intermediate container 2767757ad394
Step 4/18 : RUN VERSION=${version} PLUGINS=${plugins} /bin/sh /usr/bin/builder.sh
 ---> Running in a132428f8979
container_linux.go:265: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory"
oci runtime error: container_linux.go:265: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory"

➜  caddy-docker git:(master) git checkout 0.10.10
Switched to branch '0.10.10'
Your branch is up to date with 'origin/0.10.10'.
➜  caddy-docker git:(0.10.10) docker build -t test .
Sending build context to Docker daemon  156.2kB
Step 1/23 : FROM golang:1.9-alpine as builder
 ---> f421e93ece9c
Step 2/23 : ARG version="0.10.10"
 ---> Using cache
 ---> bdd8c3d1ec61
Step 3/23 : ARG plugins="git"
 ---> Using cache
 ---> c833a3cd0334
Step 4/23 : RUN apk add --no-cache curl git
 ---> Using cache
 ---> 08c4beb61a1f
Step 5/23 : RUN git clone https://github.com/mholt/caddy -b "v${version}" /go/src/github.com/mholt/caddy     && cd /go/src/github.com/mholt/caddy     && git checkout -b "v${version}"
 ---> Using cache
 ---> 2e0566422281
Step 6/23 : RUN go get -v github.com/abiosoft/caddyplug/caddyplug
 ---> Using cache
 ---> 80f8a7956c86
Step 7/23 : RUN for plugin in $(echo $plugins | tr "," " "); do     go get -v $(caddyplug package $plugin);     printf "package caddyhttp\nimport _ \"$(caddyplug package $plugin)\"" >         /go/src/github.com/mholt/caddy/caddyhttp/$plugin.go ;     done
 ---> Using cache
 ---> 60f5c55c19ca
Step 8/23 : RUN git clone https://github.com/caddyserver/builds /go/src/github.com/caddyserver/builds
 ---> Using cache
 ---> 6da5534beff6
Step 9/23 : RUN cd /go/src/github.com/mholt/caddy/caddy     && git checkout -f     && go run build.go     && mv caddy /go/bin
 ---> Using cache
 ---> fdbe5fbb1a26
Step 10/23 : FROM alpine:3.6
 ---> e2cd449cde75
Step 11/23 : LABEL maintainer "Abiola Ibrahim <abiola89@gmail.com>"
 ---> Using cache
 ---> 88a9b70ac269
Step 12/23 : LABEL caddy_version "0.10.10"
 ---> Using cache
 ---> e807127eccf2
Step 13/23 : RUN apk add --no-cache openssh-client git
 ---> Using cache
 ---> cd2af0b9d82d
Step 14/23 : COPY --from=builder /go/bin/caddy /usr/bin/caddy
 ---> Using cache
 ---> 93c860ccf81a
Step 15/23 : RUN /usr/bin/caddy -version
 ---> Using cache
 ---> 655ddc2eadc8
Step 16/23 : RUN /usr/bin/caddy -plugins
 ---> Using cache
 ---> 7b5e6ab22dc2
Step 17/23 : EXPOSE 80 443 2015
 ---> Using cache
 ---> bf91f85f20f1
Step 18/23 : VOLUME /root/.caddy /srv
 ---> Using cache
 ---> f72e3bef3fbe
Step 19/23 : WORKDIR /srv
 ---> Using cache
 ---> 1a1e0e056ce6
Step 20/23 : COPY Caddyfile /etc/Caddyfile
 ---> Using cache
 ---> 4de1c46ff9a9
Step 21/23 : COPY index.html /srv/index.html
 ---> Using cache
 ---> aa17c1194528
Step 22/23 : ENTRYPOINT /usr/bin/caddy
 ---> Using cache
 ---> 058d7f9991e0
Step 23/23 : CMD --conf /etc/Caddyfile --log stdout
 ---> Using cache
 ---> 71384051b2d4
Successfully built 71384051b2d4
Successfully tagged test:latest
➜  caddy-docker git:(0.10.10)
sphen13 commented 6 years ago

FWIW builds on my mac - 10.12.6: Docker version 17.09.0-ce, build afdb6d4

is it possible you need to: docker pull abiosoft/caddy:builder ?

henhuy commented 5 years ago

Thank you for your answer @sphen13 ! I spent hours, trying to build caddy docker from compose file. But I had several GO errors. Apparently, docker image of abiosoft/caddy:builder was not updated automatically within this process. After doing it by hand, everything works again. Thank you!