abiosoft / caddy-docker

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

Cannot build image using nerdctl #259

Open CornWorld opened 4 months ago

CornWorld commented 4 months ago

I'm quite new to use caddy-docker, and my CRI is containerd. I just clone the repo, and try to build the image. Would someone like to help me out?

/data/pwd/caddy-docker master !1 ···································································· root@c02 02:08:19
❯ nerdctl build --build-arg plugins=git,linode .
[+] Building 9.5s (11/18)
 => [internal] load build definition from Dockerfile                                                               0.0s
 => => transferring dockerfile: 1.22kB                                                                             0.0s
 => [internal] load metadata for docker.io/library/alpine:3.10                                                     2.6s
 => [internal] load metadata for docker.io/abiosoft/caddy:builder                                                  2.3s
 => [internal] load .dockerignore                                                                                  0.0s
 => => transferring context: 57B                                                                                   0.0s
 => CACHED [stage-1 1/9] FROM docker.io/library/alpine:3.10@sha256:451eee8bedcb2f029756dc3e9d73bab0e7943c1ac55cff  0.0s
 => => resolve docker.io/library/alpine:3.10@sha256:451eee8bedcb2f029756dc3e9d73bab0e7943c1ac55cff3a4861c52a0fdd3  0.0s
 => [internal] load build context                                                                                  0.0s
 => => transferring context: 60B                                                                                   0.0s
 => [builder 1/4] FROM docker.io/abiosoft/caddy:builder@sha256:76a51d7731a6b4a62da9f98f0916ddeb177493af6d904a866d  0.0s
 => => resolve docker.io/abiosoft/caddy:builder@sha256:76a51d7731a6b4a62da9f98f0916ddeb177493af6d904a866d65efb3f2  0.0s
 => CACHED [builder 2/4] RUN go env -w GOPROXY=https://goproxy.cn,direct                                           0.0s
 => CACHED [builder 3/4] RUN go get -v github.com/abiosoft/parent                                                  0.0s
 => ERROR [builder 4/4] RUN VERSION=1.0.3 PLUGINS=git,linode ENABLE_TELEMETRY=true /bin/sh /usr/bin/builder.sh     6.8s
 => CANCELED [stage-1 2/9] RUN apk add --no-cache     ca-certificates     git     mailcap     openssh-client       6.8s
------
 > [builder 4/4] RUN VERSION=1.0.3 PLUGINS=git,linode ENABLE_TELEMETRY=true /bin/sh /usr/bin/builder.sh:
0.105
0.105 starting stage: fetching caddy source
0.106 Cloning into '/go/src/github.com/caddyserver/caddy'...
3.929 Note: switching to 'bff2469d9d76ba5924f6d9affcf60bf44dcfa06c'.
3.929
3.929 You are in 'detached HEAD' state. You can look around, make experimental
3.929 changes and commit them, and you can discard any commits you make in this
3.929 state without impacting any branches by switching back to a branch.
3.929
3.929 If you want to create a new branch to retain commits you create, you may
3.929 do so (now or later) by using -c with the switch command. Example:
3.929
3.929   git switch -c <new-branch-name>
3.929
3.929 Or undo this operation with:
3.929
3.929   git switch -
3.929
3.929 Turn off this advice by setting config variable advice.detachedHead to false
3.929
3.959 finished stage: fetching caddy source ✓
3.960
3.960
3.960 starting stage: installing plugin helper
4.530 go: finding github.com/abiosoft/caddyplug latest
4.830 go: downloading github.com/abiosoft/caddyplug v0.0.0-20190709084344-e8cb5a02f5b4
5.081 go: extracting github.com/abiosoft/caddyplug v0.0.0-20190709084344-e8cb5a02f5b4
5.119 go: downloading golang.org/x/sys v0.0.0-20190228124157-a34e9553db1e
5.251 go: finding github.com/fatih/color v1.16.0
5.281 go: downloading github.com/fatih/color v1.16.0
5.350 go: extracting golang.org/x/sys v0.0.0-20190228124157-a34e9553db1e
5.449 go: finding github.com/abiosoft/errs latest
5.462 go: extracting github.com/fatih/color v1.16.0
5.638 go: downloading github.com/abiosoft/errs v0.0.0-20180829104210-24c3d1db1361
5.712 go: extracting github.com/abiosoft/errs v0.0.0-20180829104210-24c3d1db1361
6.071 go: downloading github.com/mattn/go-colorable v0.1.13
6.072 go: downloading github.com/mattn/go-isatty v0.0.20
6.095 go: downloading golang.org/x/sys v0.14.0
6.115 go: extracting github.com/mattn/go-isatty v0.0.20
6.133 go: extracting github.com/mattn/go-colorable v0.1.13
6.251 go: extracting golang.org/x/sys v0.14.0
6.578 go: finding github.com/mattn/go-colorable v0.1.13
6.606 go: finding github.com/mattn/go-isatty v0.0.20
6.642 go: finding golang.org/x/sys v0.14.0
6.682 /go/pkg/mod/github.com/mattn/go-isatty@v0.0.20/isatty_tcgets.go:8:8: found packages unix (affinity_linux.go) and main (mkasm.go) in /go/pkg/mod/golang.org/x/sys@v0.14.0/unix
6.685 error at 'installing plugin helper'
------
Dockerfile:15
--------------------
  13 |     RUN go get -v github.com/abiosoft/parent
  14 |
  15 | >>> RUN VERSION=${version} PLUGINS=${plugins} ENABLE_TELEMETRY=${enable_telemetry} /bin/sh /usr/bin/builder.sh
  16 |
  17 |     #
--------------------
error: failed to solve: process "/bin/sh -c VERSION=${version} PLUGINS=${plugins} ENABLE_TELEMETRY=${enable_telemetry} /bin/sh /usr/bin/builder.sh" did not complete successfully: exit code: 1
FATA[0009] no image was built

My env:

/data/pwd/caddy-docker master !1 ································································ 10s root@c02 02:08:30
❯ nerdctl -v
nerdctl version 1.6.0

/data/pwd/caddy-docker master !1 ···································································· root@c02 02:11:49
❯ containerd -v
containerd github.com/containerd/containerd v1.7.7 8c087663b0233f6e6e2f4515cee61d49f14746a8.m