-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not compile in docker under Apple Silicon #33
Comments
Hi @halostatue ! Finally managed to fix the CI pipeline, which was holding back a fix for this. I've applied your suggestion to set GOARCH=ARM64. This is passed onto the docker GO environment which compiles dockerized. However, I'm not sure that it will now compile correctly. Could you have a try, with the latest version?
|
Will do. |
No luck: ❯ bin/dockerized --compile
Compiling dockerized...
go: downloading github.com/compose-spec/compose-go v1.1.0
go: downloading github.com/docker/compose/v2 v2.3.3
go: downloading github.com/fatih/color v1.13.0
go: downloading github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6
go: downloading github.com/docker/cli v20.10.3-0.20210702143511-f782d1355eff+incompatible
go: downloading github.com/docker/distribution v2.8.1+incompatible
go: downloading github.com/docker/hub-tool v0.4.4
go: downloading github.com/hashicorp/go-version v1.3.0
go: downloading github.com/distribution/distribution/v3 v3.0.0-20210316161203-a01c71e2477e
go: downloading github.com/docker/go-connections v0.4.0
go: downloading github.com/mitchellh/mapstructure v1.4.3
go: downloading github.com/opencontainers/go-digest v1.0.0
go: downloading golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
go: downloading github.com/mattn/go-colorable v0.1.12
go: downloading github.com/mattn/go-isatty v0.0.14
go: downloading golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e
go: downloading github.com/pkg/errors v0.9.1
go: downloading github.com/sirupsen/logrus v1.8.1
go: downloading github.com/docker/go-units v0.4.0
go: downloading github.com/imdario/mergo v0.3.12
go: downloading github.com/mattn/go-shellwords v1.0.12
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading github.com/spf13/pflag v1.0.5
go: downloading github.com/docker/docker v20.10.3-0.20220121014307-40bb9831756f+incompatible
go: downloading github.com/spf13/cobra v1.3.0
go: downloading github.com/theupdateframework/notary v0.6.1
go: downloading github.com/buger/goterm v1.0.4
go: downloading github.com/containerd/containerd v1.6.1
go: downloading github.com/docker/buildx v0.7.1
go: downloading github.com/hashicorp/go-multierror v1.1.1
go: downloading github.com/moby/buildkit v0.9.1-0.20211019185819-8778943ac3da
go: downloading github.com/opencontainers/image-spec v1.0.2
go: downloading github.com/sanathkr/go-yaml v0.0.0-20170819195128-ed9d249f429b
go: downloading github.com/google/uuid v1.2.0
go: downloading github.com/xeipuuv/gojsonschema v1.2.0
go: downloading github.com/fvbommel/sortorder v1.0.2
go: downloading github.com/morikuni/aec v1.0.0
go: downloading github.com/containerd/console v1.0.3
go: downloading github.com/AlecAivazis/survey/v2 v2.3.2
go: downloading github.com/golang/mock v1.6.0
go: downloading google.golang.org/grpc v1.45.0
go: downloading github.com/klauspost/compress v1.13.5
go: downloading github.com/opencontainers/runc v1.1.0
go: downloading golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac
go: downloading github.com/moby/sys/signal v0.6.0
go: downloading github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
go: downloading github.com/tonistiigi/fsutil v0.0.0-20210818161904-4442383b5028
go: downloading github.com/tonistiigi/opentelemetry-go-contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.0.0-20210714055410-d010b05b4939
go: downloading go.opentelemetry.io/contrib v0.21.0
go: downloading go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.3.0
go: downloading go.opentelemetry.io/otel v1.3.0
go: downloading go.opentelemetry.io/otel/sdk v1.3.0
go: downloading go.opentelemetry.io/otel/trace v1.3.0
go: downloading golang.org/x/net v0.0.0-20211216030914-fe4d6282115f
go: downloading github.com/gofrs/flock v0.8.0
go: downloading golang.org/x/crypto v0.0.0-20210817164053-32db794688a5
go: downloading github.com/docker/docker-credential-helpers v0.6.4
go: downloading github.com/moby/sys/symlink v0.2.0
go: downloading google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa
go: downloading github.com/gogo/protobuf v1.3.2
go: downloading github.com/golang/protobuf v1.5.2
go: downloading github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
go: downloading github.com/gogo/googleapis v1.4.0
go: downloading github.com/containerd/typeurl v1.0.2
go: downloading go.opentelemetry.io/proto/otlp v0.11.0
go: downloading google.golang.org/protobuf v1.27.1
go: downloading github.com/containerd/continuity v0.2.2
go: downloading github.com/grpc-ecosystem/grpc-gateway v1.16.0
go: downloading github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea
go: downloading github.com/tonistiigi/vt100 v0.0.0-20210615222946-8066bb97264f
go: downloading golang.org/x/text v0.3.7
/go/pkg/mod/github.com/docker/compose/v2@v2.3.3/pkg/prompt/prompt.go:20:2: zip: not a valid zip file
/go/pkg/mod/github.com/tonistiigi/fsutil@v0.0.0-20210818161904-4442383b5028/diskwriter_unix.go:9:2: zip: not a valid zip file
/go/pkg/mod/github.com/docker/compose/v2@v2.3.3/pkg/compose/build.go:26:2: zip: not a valid zip file
/go/pkg/mod/github.com/docker/compose/v2@v2.3.3/pkg/compose/build_buildkit.go:26:2: zip: not a valid zip file
/go/pkg/mod/github.com/docker/compose/v2@v2.3.3/pkg/compose/build.go:27:2: zip: not a valid zip file
/go/pkg/mod/github.com/docker/compose/v2@v2.3.3/pkg/compose/build.go:28:2: zip: not a valid zip file
/go/pkg/mod/github.com/docker/compose/v2@v2.3.3/pkg/compose/build.go:29:2: zip: not a valid zip file
/go/pkg/mod/github.com/docker/cli@v20.10.3-0.20210702143511-f782d1355eff+incompatible/cli/manifest/types/types.go:6:2: zip: not a valid zip file
/go/pkg/mod/github.com/docker/cli@v20.10.3-0.20210702143511-f782d1355eff+incompatible/cli/manifest/types/types.go:7:2: zip: not a valid zip file
/go/pkg/mod/github.com/docker/cli@v20.10.3-0.20210702143511-f782d1355eff+incompatible/cli/manifest/types/types.go:8:2: zip: not a valid zip file
/go/pkg/mod/github.com/docker/docker@v20.10.3-0.20220121014307-40bb9831756f+incompatible/client/container_commit.go:9:2: zip: not a valid zip file
/go/pkg/mod/github.com/docker/docker@v20.10.3-0.20220121014307-40bb9831756f+incompatible/errdefs/http_helpers.go:8:2: zip: not a valid zip file
/go/pkg/mod/github.com/docker/cli@v20.10.3-0.20210702143511-f782d1355eff+incompatible/cli/registry/client/fetcher.go:14:2: zip: not a valid zip file
/go/pkg/mod/github.com/docker/cli@v20.10.3-0.20210702143511-f782d1355eff+incompatible/cli/registry/client/client.go:13:2: zip: not a valid zip file
/go/pkg/mod/github.com/docker/cli@v20.10.3-0.20210702143511-f782d1355eff+incompatible/cli/trust/trust.go:17:2: zip: not a valid zip file
/go/pkg/mod/github.com/docker/cli@v20.10.3-0.20210702143511-f782d1355eff+incompatible/cli/trust/trust.go:18:2: zip: not a valid zip file
/go/pkg/mod/github.com/docker/cli@v20.10.3-0.20210702143511-f782d1355eff+incompatible/cli/trust/trust.go:19:2: zip: not a valid zip file
/go/pkg/mod/github.com/compose-spec/compose-go@v1.1.0/loader/loader.go:38:2: zip: not a valid zip file
/go/pkg/mod/github.com/moby/buildkit@v0.9.1-0.20211019185819-8778943ac3da/frontend/gateway/grpcclient/client.go:16:2: zip: not a valid zip file
/go/pkg/mod/github.com/moby/buildkit@v0.9.1-0.20211019185819-8778943ac3da/api/services/control/control.pb.go:9:2: zip: not a valid zip file
/go/pkg/mod/github.com/docker/docker@v20.10.3-0.20220121014307-40bb9831756f+incompatible/api/types/swarm/runtime/plugin.pb.go:16:8: zip: not a valid zip file
/go/pkg/mod/github.com/moby/buildkit@v0.9.1-0.20211019185819-8778943ac3da/solver/pb/ops.pb.go:13:2: zip: not a valid zip file
/go/pkg/mod/github.com/moby/buildkit@v0.9.1-0.20211019185819-8778943ac3da/api/services/control/control.pb.go:11:2: zip: not a valid zip file
/go/pkg/mod/go.opentelemetry.io/proto/otlp@v0.11.0/collector/trace/v1/trace_service.pb.gw.go:16:2: zip: not a valid zip file
/go/pkg/mod/google.golang.org/grpc@v1.45.0/internal/status/status.go:34:2: zip: not a valid zip file
/go/pkg/mod/google.golang.org/grpc@v1.45.0/internal/status/status.go:35:2: zip: not a valid zip file
/go/pkg/mod/github.com/moby/buildkit@v0.9.1-0.20211019185819-8778943ac3da/frontend/gateway/grpcclient/client.go:18:2: zip: not a valid zip file
/go/pkg/mod/github.com/moby/buildkit@v0.9.1-0.20211019185819-8778943ac3da/api/services/control/control.pb.go:12:2: zip: not a valid zip file
/go/pkg/mod/go.opentelemetry.io/proto/otlp@v0.11.0/collector/trace/v1/trace_service.pb.gw.go:18:2: zip: not a valid zip file
/go/pkg/mod/go.opentelemetry.io/proto/otlp@v0.11.0/collector/trace/v1/trace_service.pb.gw.go:19:2: zip: not a valid zip file
/go/pkg/mod/github.com/docker/compose/v2@v2.3.3/pkg/compose/build_classic.go:40:2: zip: not a valid zip file
/go/pkg/mod/github.com/distribution/distribution/v3@v3.0.0-20210316161203-a01c71e2477e/digestset/set.go:9:2: zip: not a valid zip file
/go/pkg/mod/github.com/docker/docker@v20.10.3-0.20220121014307-40bb9831756f+incompatible/pkg/idtools/idtools_unix.go:17:2: zip: not a valid zip file
/go/pkg/mod/github.com/docker/cli@v20.10.3-0.20210702143511-f782d1355eff+incompatible/cli/command/cli.go:35:2: zip: not a valid zip file
/go/pkg/mod/github.com/docker/cli@v20.10.3-0.20210702143511-f782d1355eff+incompatible/cli/flags/common.go:12:2: zip: not a valid zip file
/go/pkg/mod/github.com/docker/cli@v20.10.3-0.20210702143511-f782d1355eff+incompatible/cli/trust/trust.go:27:2: zip: not a valid zip file
/go/pkg/mod/github.com/docker/cli@v20.10.3-0.20210702143511-f782d1355eff+incompatible/cli/trust/trust.go:28:2: zip: not a valid zip file
/go/pkg/mod/github.com/docker/cli@v20.10.3-0.20210702143511-f782d1355eff+incompatible/cli/trust/trust.go:29:2: zip: not a valid zip file
/go/pkg/mod/github.com/docker/cli@v20.10.3-0.20210702143511-f782d1355eff+incompatible/cli/trust/trust.go:30:2: zip: not a valid zip file
/go/pkg/mod/github.com/docker/cli@v20.10.3-0.20210702143511-f782d1355eff+incompatible/cli/trust/trust.go:31:2: zip: not a valid zip file
/go/pkg/mod/github.com/docker/cli@v20.10.3-0.20210702143511-f782d1355eff+incompatible/cli/trust/trust.go:32:2: zip: not a valid zip file
/go/pkg/mod/github.com/docker/cli@v20.10.3-0.20210702143511-f782d1355eff+incompatible/cli/trust/trust.go:33:2: zip: not a valid zip file
/go/pkg/mod/github.com/docker/cli@v20.10.3-0.20210702143511-f782d1355eff+incompatible/cli/trust/trust.go:34:2: zip: not a valid zip file
/go/pkg/mod/github.com/compose-spec/compose-go@v1.1.0/schema/schema.go:24:2: zip: not a valid zip file
/go/pkg/mod/github.com/moby/buildkit@v0.9.1-0.20211019185819-8778943ac3da/session/grpc.go:13:2: zip: not a valid zip file
/go/pkg/mod/go.opentelemetry.io/otel/exporters/otlp/otlptrace@v1.3.0/internal/tracetransform/instrumentation.go:18:2: zip: not a valid zip file
/go/pkg/mod/go.opentelemetry.io/otel/exporters/otlp/otlptrace@v1.3.0/internal/tracetransform/attribute.go:19:2: zip: not a valid zip file
/go/pkg/mod/go.opentelemetry.io/otel/exporters/otlp/otlptrace@v1.3.0/internal/tracetransform/span.go:21:2: zip: not a valid zip file
/go/pkg/mod/github.com/moby/buildkit@v0.9.1-0.20211019185819-8778943ac3da/util/bklog/log.go:7:2: zip: not a valid zip file
/go/pkg/mod/github.com/moby/buildkit@v0.9.1-0.20211019185819-8778943ac3da/session/auth/auth.go:12:2: zip: not a valid zip file
/go/pkg/mod/github.com/moby/buildkit@v0.9.1-0.20211019185819-8778943ac3da/util/sshutil/keyscan.go:9:2: zip: not a valid zip file
/go/pkg/mod/github.com/compose-spec/compose-go@v1.1.0/types/project.go:27:2: zip: not a valid zip file
Failed to compile dockerized |
Strange. I'm suspecting it has to do with the volume mount which caches the go packages. Also due to #34 . Could you try removing the cache volume from Line 80 in 033f7dd
if [ "${DOCKERIZED_COMPILE:-docker}" == "docker" ]; then
docker run \
--rm \
--entrypoint=go \
-e "GOOS=${DOCKERIZED_COMPILE_GOOS}" \
-e "GOARCH=${DOCKERIZED_COMPILE_GOARCH}" \
-v "${DOCKERIZED_ROOT}:/src" \
-v "${DOCKERIZED_ROOT}/build:/build" \
- -v "${DOCKERIZED_ROOT}/.cache:/go/pkg" \
-w //src \
"golang:1.17.8" \
build -ldflags "$GO_LDFLAGS" -o //build/ . |
That worked. Related to that, I have had to |
One thing: |
Thanks for trying! I wonder if the problem isn't rather that docker itself runs as root. Someone at hackernews also pointed out that a lack of user-mapping can cause problems with file ownership: https://news.ycombinator.com/item?id=30629926 . What are the file permissions of the binary on your system? i.e. |
I’ll have to try a bit later. I did |
## [2.19.4](v2.19.3...v2.19.4) (2022-04-22) ### Bug Fixes * Does not compile in docker under Apple Silicon ([94928c6](94928c6)), closes [#33](#33)
🎉 This issue has been resolved in version 2.19.4 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Thanks for your testing, it helped hash out a solution. Turns out on Ubuntu the binary was also owned by root, but with I was able to work around the issue by:
Please try out the new release if you can :-) |
Looks good except for the other issue I have open. |
Compiling on the host works just fine.
The text was updated successfully, but these errors were encountered: