tijjjy / Tailscale-DERP-Docker

Docker container to self host Tailscale DERP server
66 stars 24 forks source link

build fails #1

Closed MartinVerges closed 1 year ago

MartinVerges commented 1 year ago

I try following your nice blog, but somehow building it failed. Can you maybe assist?

$ docker build . -t tailscale-derp-docker:1.0
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            Install the buildx component to build images with BuildKit:
            https://docs.docker.com/go/buildx/

Sending build context to Docker daemon  74.24kB
Step 1/14 : FROM alpine:latest
latest: Pulling from library/alpine
63b65145d645: Pull complete 
Digest: sha256:69665d02cb32192e52e07644d76bc6f25abeb5410edc1c7a81a10ba3f0efb90a
Status: Downloaded newer image for alpine:latest
 ---> b2aa39c304c2
Step 2/14 : RUN apk add go
 ---> Running in 2bee748e0db6
fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/community/x86_64/APKINDEX.tar.gz
(1/12) Installing libgcc (12.2.1_git20220924-r4)
(2/12) Installing libstdc++ (12.2.1_git20220924-r4)
(3/12) Installing binutils (2.39-r2)
(4/12) Installing libgomp (12.2.1_git20220924-r4)
(5/12) Installing libatomic (12.2.1_git20220924-r4)
(6/12) Installing gmp (6.2.1-r2)
(7/12) Installing isl25 (0.25-r0)
(8/12) Installing mpfr4 (4.1.0-r0)
(9/12) Installing mpc1 (1.2.1-r1)
(10/12) Installing gcc (12.2.1_git20220924-r4)
(11/12) Installing musl-dev (1.2.3-r4)
(12/12) Installing go (1.19.6-r0)
Executing busybox-1.35.0-r29.trigger
OK: 560 MiB in 27 packages
Removing intermediate container 2bee748e0db6
 ---> 5b88e2953aa0
Step 3/14 : RUN go install tailscale.com/cmd/derper@main
 ---> Running in 769d63f522eb
go: downloading tailscale.com v1.1.1-0.20230219054353-d38abe90be07
go: downloading go4.org/mem v0.0.0-20210711025021-927187094b94
go: downloading golang.org/x/crypto v0.6.0
go: downloading golang.org/x/time v0.0.0-20220609170525-579cf78fd858
go: downloading nhooyr.io/websocket v1.8.7
go: downloading golang.org/x/sync v0.1.0
go: downloading golang.org/x/sys v0.5.0
go: downloading github.com/klauspost/compress v1.15.4
go: downloading github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
go: downloading golang.org/x/net v0.7.0
go: downloading golang.org/x/exp v0.0.0-20221205204356-47842c84f3db
go: downloading github.com/mitchellh/go-ps v1.0.0
go: downloading github.com/fxamacker/cbor/v2 v2.4.0
go: downloading github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3
go: downloading github.com/jsimonetti/rtnetlink v1.1.2-0.20220408201609-d380b505068b
go: downloading github.com/mdlayher/netlink v1.7.1
go: downloading golang.org/x/text v0.7.0
go: downloading github.com/x448/float16 v0.8.4
go: downloading filippo.io/edwards25519 v1.0.0-rc.1
go: downloading github.com/josharian/native v1.1.1-0.20230202152459-5c7d0dd6ab86
go: downloading github.com/mdlayher/socket v0.4.0
go: downloading go4.org/netipx v0.0.0-20220725152314-7e7bdc8411bf
# tailscale.com/types/key
root/go/pkg/mod/tailscale.com@v1.1.1-0.20230219054353-d38abe90be07/types/key/machine.go:90:15: undefined: bytes.Clone
root/go/pkg/mod/tailscale.com@v1.1.1-0.20230219054353-d38abe90be07/types/key/machine.go:234:15: undefined: bytes.Clone
note: module requires Go 1.20
# tailscale.com/net/tshttpproxy
root/go/pkg/mod/tailscale.com@v1.1.1-0.20230219054353-d38abe90be07/net/tshttpproxy/tshttpproxy.go:112:5: tr.OnProxyConnectResponse undefined (type *http.Transport has no field or method OnProxyConnectResponse)
note: module requires Go 1.20
# tailscale.com/net/stun
root/go/pkg/mod/tailscale.com@v1.1.1-0.20230219054353-d38abe90be07/net/stun/stun.go:304:15: undefined: bytes.Clone
note: module requires Go 1.20
The command '/bin/sh -c go install tailscale.com/cmd/derper@main' returned a non-zero code: 2
MartinVerges commented 1 year ago

changed Dockerfile:

- RUN go install tailscale.com/cmd/derper@main
+ RUN go install tailscale.com/cmd/derper@v1.36.1
tijjjy commented 1 year ago

changed Dockerfile:

- RUN go install tailscale.com/cmd/derper@main
+ RUN go install tailscale.com/cmd/derper@v1.36.1

Hi, thanks for pointing out this issue,

I've pushed the fix you mentioned by changing the version of the golang derper version and the container now builds.