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
Build fails on Mac #46987
Comments
Do you have more information how this package is used in your code-base on macOS? While those linked PRs fix the compile issue, those packages are intended for internal use in the daemon, and never designed to be used on macOS, so I'm curious how this code ended up in macOS code in your project. |
I'm also failing to compile on Mac main.go (code from https://pkg.go.dev/github.com/docker/docker/client#section-readme)
I tried installing from head
There is a solution posted here:
This also doesn't help the issue. I guess I am missing errdefs still?
There are some files in there, am I missing any? If so how do I get these missing files? |
Tried reproducing, but didn't get that error; I should note that in my flow below, I didn't specify versions of indirect dependencies, and let go version
go version go1.22.1 darwin/arm64
mkdir repro-46987 && cd repro-46987
go mod init myproject
cat > main.go <<-'EOF'
package main
import (
"context"
"fmt"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/client"
)
func main() {
cli, err := client.NewClientWithOpts(client.FromEnv)
if err != nil {
panic(err)
}
containers, err := cli.ContainerList(context.Background(), container.ListOptions{})
if err != nil {
panic(err)
}
for _, ctr := range containers {
fmt.Printf("%s %s\n", ctr.ID, ctr.Image)
}
}
EOF
gofmt -w main.go
go get github.com/docker/docker@v26.0.1+incompatible
go mod tidy
go run main.go
e1698b649a0714d0425f48aac4cb3c19194093b08a9d9381da6c053dafa19563 nginx:alpine |
Your flow doesn't reproduce the issue and works, so thanks! The problem must be user error on my part. |
Just FYI, but I ran into the same errors with @elliotthill and realized |
Description
Seems that ever since #44210 was merged in 24.0.0 build on Mac machines fail due to the missing
goInChroot
function.Reproduce
main.go
:$ GOOS=darwin go build main.go # github.com/docker/docker/pkg/chrootarchive ../../../go/pkg/mod/github.com/docker/docker@v24.0.7+incompatible/pkg/chrootarchive/archive_unix.go:31:8: undefined: goInChroot ../../../go/pkg/mod/github.com/docker/docker@v24.0.7+incompatible/pkg/chrootarchive/archive_unix.go:53:8: undefined: goInChroot ../../../go/pkg/mod/github.com/docker/docker@v24.0.7+incompatible/pkg/chrootarchive/diff_unix.go:45:8: undefined: goInChroot
But on Linux it works just fine:
Expected behavior
Project should compile on Darwin like it did before.
docker version
Not relevant, it's a build issue.
docker info
Not relevant, it's a build issue.
Additional Info
Current workaround is to downgrade to v23:
The text was updated successfully, but these errors were encountered: