klzgrad / naiveproxy

Make a fortune quietly
BSD 3-Clause "New" or "Revised" License
6.67k stars 885 forks source link

AWS lightsail docker 编译失败 #251

Closed Joyace closed 2 years ago

Joyace commented 2 years ago

日志:

root@ip-172-26-3-151:~/docker# docker-compose up -d
-bash: docker-compose: command not found
root@ip-172-26-3-151:~/docker# apt-get install sudo
Reading package lists... Done
Building dependency tree       
Reading state information... Done
sudo is already the newest version (1.8.27-1+deb10u3).
0 upgraded, 0 newly installed, 0 to remove and 62 not upgraded.
root@ip-172-26-3-151:~/docker# sudo chmod +x /usr/local/bin/docker-compose
root@ip-172-26-3-151:~/docker# sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
root@ip-172-26-3-151:~/docker# docker-compose --version
Docker Compose version v2.2.3
root@ip-172-26-3-151:~/docker# docker-compose up -d
[+] Running 5/5
 ⠿ xray Pulled                                                                                            9.2s
   ⠿ 59bf1c3509f3 Pull complete                                                                           1.8s
   ⠿ 8311d7b965ab Pull complete                                                                           1.9s
   ⠿ 07080a45caeb Pull complete                                                                           3.2s
   ⠿ 510b93cd697c Pull complete                                                                           4.3s
Sending build context to Docker daemon  6.598kB
Step 1/5 : FROM caddy:builder AS builder
builder: Pulling from library/caddy
59bf1c3509f3: Already exists 
666ba61612fd: Pull complete 
8ed8ca486205: Pull complete 
4fe6c5a15a65: Pull complete 
22a0e8bec74d: Pull complete 
5e6b9a909308: Pull complete 
f50c8f22ae2a: Pull complete 
ee5c2bdf23d4: Pull complete 
Digest: sha256:3cb4b7be4b3dcff3addd2518b6b10c945c0f4e5575c4e465635e7f29b47b0298
Status: Downloaded newer image for caddy:builder
 ---> dfe8eb81a786
Step 2/5 : RUN xcaddy build     --with github.com/mholt/caddy-webdav    --with github.com/caddyserver/forwardproxy@caddy2=github.com/klzgrad/forwardproxy@naive
 ---> Running in 0a01ae3e9137
2022/01/15 06:17:55 [INFO] Temporary folder: /tmp/buildenv_2022-01-15-0617.830897063
2022/01/15 06:17:55 [INFO] Writing main module: /tmp/buildenv_2022-01-15-0617.830897063/main.go
2022/01/15 06:17:55 [INFO] Initializing Go module
2022/01/15 06:17:55 [INFO] exec (timeout=10s): /usr/local/go/bin/go mod init caddy 
go: creating new go.mod: module caddy
go: to add module requirements and sums:
        go mod tidy
2022/01/15 06:17:55 [INFO] Replace github.com/caddyserver/forwardproxy => github.com/klzgrad/forwardproxy@naive
2022/01/15 06:17:55 [INFO] exec (timeout=10s): /usr/local/go/bin/go mod edit -replace github.com/caddyserver/forwardproxy=github.com/klzgrad/forwardproxy@naive 
2022/01/15 06:17:55 [INFO] Pinning versions
2022/01/15 06:17:55 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v github.com/caddyserver/caddy/v2@v2.4.6 
go: downloading github.com/caddyserver/caddy/v2 v2.4.6
go: downloading github.com/caddyserver/certmagic v0.15.2
go: downloading github.com/google/uuid v1.3.0
go: downloading github.com/prometheus/client_golang v1.11.0
go: downloading go.uber.org/zap v1.19.0
go: downloading golang.org/x/term v0.0.0-20210503060354-a79de5458b56
go: downloading github.com/klauspost/cpuid/v2 v2.0.9
go: downloading github.com/libdns/libdns v0.2.1
go: downloading github.com/mholt/acmez v1.0.1
go: downloading github.com/miekg/dns v1.1.43
go: downloading golang.org/x/crypto v0.0.0-20210915214749-c084706c2272
go: downloading golang.org/x/net v0.0.0-20210913180222-943fd674d43e
go: downloading github.com/beorn7/perks v1.0.1
go: downloading github.com/cespare/xxhash/v2 v2.1.1
go: downloading github.com/cespare/xxhash v1.1.0
go: downloading github.com/golang/protobuf v1.5.2
go: downloading github.com/prometheus/client_model v0.2.0
go: downloading github.com/prometheus/common v0.26.0
go: downloading github.com/prometheus/procfs v0.6.0
go: downloading golang.org/x/sys v0.0.0-20210915083310-ed5796bab164
go: downloading go.uber.org/atomic v1.7.0
go: downloading go.uber.org/multierr v1.6.0
go: downloading golang.org/x/text v0.3.7
go: downloading google.golang.org/protobuf v1.27.1
go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.1
go get: added github.com/beorn7/perks v1.0.1
go get: added github.com/caddyserver/caddy/v2 v2.4.6
go get: added github.com/caddyserver/certmagic v0.15.2
go get: added github.com/cespare/xxhash/v2 v2.1.1
go get: added github.com/golang/protobuf v1.5.2
go get: added github.com/google/uuid v1.3.0
go get: added github.com/klauspost/cpuid/v2 v2.0.9
go get: added github.com/libdns/libdns v0.2.1
go get: added github.com/matttproud/golang_protobuf_extensions v1.0.1
go get: added github.com/mholt/acmez v1.0.1
go get: added github.com/miekg/dns v1.1.43
go get: added github.com/prometheus/client_golang v1.11.0
go get: added github.com/prometheus/client_model v0.2.0
go get: added github.com/prometheus/common v0.26.0
go get: added github.com/prometheus/procfs v0.6.0
go get: added go.uber.org/atomic v1.7.0
go get: added go.uber.org/multierr v1.6.0
go get: added go.uber.org/zap v1.19.0
go get: added golang.org/x/crypto v0.0.0-20210915214749-c084706c2272
go get: added golang.org/x/net v0.0.0-20210913180222-943fd674d43e
go get: added golang.org/x/sys v0.0.0-20210915083310-ed5796bab164
go get: added golang.org/x/term v0.0.0-20210503060354-a79de5458b56
go get: added golang.org/x/text v0.3.7
go get: added google.golang.org/protobuf v1.27.1
2022/01/15 06:20:19 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v github.com/mholt/caddy-webdav 
go: downloading github.com/mholt/caddy-webdav v0.0.0-20210914165325-f7b67f8ca1e6
go: downloading github.com/dustin/go-humanize v1.0.1-0.20200219035652-afde56e7acac
go: downloading github.com/google/cel-go v0.7.3
go: downloading github.com/lucas-clemente/quic-go v0.23.0
go: downloading google.golang.org/genproto v0.0.0-20210719143636-1d5a45f8e492
go: downloading github.com/smallstep/certificates v0.17.5-0.20211008195551-04fe3126bebf
go: downloading github.com/smallstep/cli v0.17.6
go: downloading github.com/smallstep/truststore v0.9.6
go: downloading github.com/stoewer/go-strcase v1.2.0
go: downloading github.com/marten-seemann/qpack v0.2.1
go: downloading github.com/pkg/errors v0.9.1
go: downloading github.com/smallstep/nosql v0.3.8
go: downloading go.step.sm/cli-utils v0.6.0
go: downloading go.step.sm/crypto v0.11.0
go: downloading go.step.sm/linkedca v0.5.0
go: downloading google.golang.org/grpc v1.39.0
go: downloading gopkg.in/square/go-jose.v2 v2.6.0
go: downloading howett.net/plist v0.0.0-20181124034731-591f970eefbb
go: downloading github.com/antlr/antlr4 v0.0.0-20200503195918-621b933c7a7f
go: downloading github.com/cheekybits/genny v1.0.0
go: downloading github.com/onsi/ginkgo v1.16.4
go: downloading github.com/marten-seemann/qtls-go1-16 v0.1.4
go: downloading github.com/marten-seemann/qtls-go1-17 v0.1.0
go: downloading github.com/micromdm/scep/v2 v2.1.0
go: downloading go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352
go: downloading github.com/Masterminds/sprig/v3 v3.2.2
go: downloading github.com/Masterminds/sprig v2.22.0+incompatible
go: downloading github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e
go: downloading github.com/manifoldco/promptui v0.8.0
go: downloading github.com/urfave/cli v1.22.5
go: downloading github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0
go: downloading github.com/rs/xid v1.2.1
go: downloading github.com/sirupsen/logrus v1.7.0
go: downloading github.com/go-kit/kit v0.10.0
go: downloading github.com/Masterminds/goutils v1.1.1
go: downloading github.com/Masterminds/semver/v3 v3.1.1
go: downloading github.com/Masterminds/semver v1.5.0
go: downloading github.com/huandu/xstrings v1.3.2
go: downloading github.com/imdario/mergo v0.3.12
go: downloading github.com/mitchellh/copystructure v1.2.0
go: downloading github.com/shopspring/decimal v1.2.0
go: downloading github.com/spf13/cast v1.4.1
go: downloading github.com/dgraph-io/badger v1.6.2
go: downloading github.com/dgraph-io/badger/v2 v2.2007.4
go: downloading go.etcd.io/bbolt v1.3.6
go: downloading github.com/go-sql-driver/mysql v1.6.0
go: downloading github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.0
go: downloading github.com/cpuguy83/go-md2man v1.0.10
go: downloading golang.org/x/tools v0.1.5
go: downloading github.com/go-logfmt/logfmt v0.5.0
go: downloading github.com/mitchellh/reflectwalk v1.0.2
go: downloading github.com/dgraph-io/ristretto v0.0.4-0.20200906165740-41ebdbffecfd
go: downloading github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13
go: downloading github.com/mattn/go-colorable v0.1.8
go: downloading github.com/mattn/go-isatty v0.0.13
go: downloading github.com/russross/blackfriday/v2 v2.0.1
go: downloading github.com/russross/blackfriday v1.5.2
go: downloading github.com/samfoo/ansi v0.0.0-20160124022901-b6bd2ded7189
go: downloading github.com/nxadm/tail v1.4.8
go: downloading github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d
go: downloading github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96
go: downloading github.com/golang/snappy v0.0.3
go: downloading github.com/klauspost/compress v1.13.6
go: downloading github.com/lunixbochs/vtclean v1.0.0
go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
go: downloading golang.org/x/mod v0.4.2
go: downloading gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7
go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
go: downloading github.com/fsnotify/fsnotify v1.4.9
go get: added github.com/mholt/caddy-webdav v0.0.0-20210914165325-f7b67f8ca1e6
2022/01/15 06:21:39 [INFO] Build environment ready
2022/01/15 06:21:39 [INFO] Building Caddy
2022/01/15 06:21:39 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod tidy 
go: downloading github.com/stretchr/testify v1.7.0
go: downloading go.uber.org/goleak v1.1.10
go: downloading github.com/go-chi/chi v4.1.2+incompatible
go: downloading gopkg.in/natefinch/lumberjack.v2 v2.0.0
go: downloading github.com/benbjohnson/clock v1.1.0
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
go: downloading golang.org/x/lint v0.0.0-20210508222113-6edffad5e616
go: downloading github.com/alecthomas/chroma v0.9.2
go: downloading github.com/naoina/toml v0.1.1
go: downloading github.com/yuin/goldmark v1.4.1
go: downloading github.com/yuin/goldmark-highlighting v0.0.0-20210516132338-9216f9c5aa01
go: downloading github.com/smallstep/assert v0.0.0-20200723003110-82e2b9b3b262
go: downloading github.com/BurntSushi/toml v0.3.1
go: downloading github.com/golang/mock v1.6.0
go: downloading github.com/onsi/gomega v1.13.0
go: downloading github.com/google/go-cmp v0.5.6
go: downloading gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15
go: downloading github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38
go: downloading github.com/naoina/go-stringutil v0.1.0
go: downloading github.com/kylelemons/godebug v1.1.0
go: downloading github.com/kr/pretty v0.2.1
go: downloading github.com/dlclark/regexp2 v1.4.0
go: downloading github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721
go: downloading github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897
go: downloading github.com/sergi/go-diff v1.2.0
go: downloading github.com/aws/aws-sdk-go v1.37.0
go: downloading cloud.google.com/go v0.83.0
go: downloading github.com/googleapis/gax-go/v2 v2.0.5
go: downloading github.com/googleapis/gax-go v2.0.2+incompatible
go: downloading google.golang.org/api v0.48.0
go: downloading github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1
go: downloading github.com/kr/text v0.2.0
go: downloading github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964
go: downloading golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c
go: downloading github.com/go-stack/stack v1.8.0
go: downloading github.com/chzyer/logex v1.1.10
go: downloading github.com/jmespath/go-jmespath v0.4.0
go: downloading go.opencensus.io v0.23.0
go: downloading google.golang.org/appengine v1.6.7
go: downloading github.com/OneOfOne/xxhash v1.2.2
go: downloading github.com/spaolacci/murmur3 v1.1.0
go: downloading github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
go: downloading github.com/klzgrad/forwardproxy v0.0.0-20210613072432-ff60d3bb5ad1
go: found github.com/caddyserver/forwardproxy in github.com/caddyserver/forwardproxy v0.0.0-00010101000000-000000000000
go: downloading github.com/klauspost/cpuid v1.2.5
2022/01/15 06:22:20 [INFO] exec (timeout=0s): /usr/local/go/bin/go build -o /usr/bin/caddy -ldflags -w -s -trimpath 
go build github.com/yuin/goldmark/util: /usr/local/go/pkg/tool/linux_amd64/compile: signal: killed
2022/01/15 06:44:52 [INFO] Skipping cleanup as requested; leaving folder intact: /tmp/buildenv_2022-01-15-0617.830897063
2022/01/15 06:44:52 [FATAL] exit status 1
1 error occurred:
        * Status: The command '/bin/sh -c xcaddy build     --with github.com/mholt/caddy-webdav         --with github.com/caddyserver/forwardproxy@caddy2=github.com/klzgrad/forwardproxy@naive' returned a non-zero code: 1, Code: 1

Dockerfile

FROM caddy:builder AS builder

RUN xcaddy build \
    --with github.com/mholt/caddy-webdav \
    --with github.com/caddyserver/forwardproxy@caddy2=github.com/klzgrad/forwardproxy@naive

FROM caddy:builder

COPY --from=builder /usr/bin/caddy /usr/bin/caddy

CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]

相同配置在甲骨文可以正常编译运行

klzgrad commented 2 years ago

caddy的编译问题是无关问题

ghost commented 2 years ago

caddy的编译问题是无关问题

编译环境中的内存不足吧