Skip to content
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

[Bug]: v0.31.0 failing due to docker type removed in docker/docker dependency #2583

Closed
KrazyK786 opened this issue Jun 14, 2024 · 6 comments · Fixed by #2584
Closed

[Bug]: v0.31.0 failing due to docker type removed in docker/docker dependency #2583

KrazyK786 opened this issue Jun 14, 2024 · 6 comments · Fixed by #2584
Labels
bug An issue with the library

Comments

@KrazyK786
Copy link

Testcontainers version

0.31.0

Using the latest Testcontainers version?

Yes

Host OS

MacOS

Host arch

ARM64

Go version

1.22.3

Docker version

Client:
 Cloud integration: v1.0.35+desktop.13
 Version:           26.1.1
 API version:       1.45
 Go version:        go1.21.9
 Git commit:        4cf5afa
 Built:             Tue Apr 30 11:44:56 2024
 OS/Arch:           darwin/arm64
 Context:           desktop-linux

Server: Docker Desktop 4.30.0 (149282)
 Engine:
  Version:          26.1.1
  API version:      1.45 (minimum version 1.24)
  Go version:       go1.21.9
  Git commit:       ac2de55
  Built:            Tue Apr 30 11:48:04 2024
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.6.31
  GitCommit:        e377cd56a71523140ca6ae87e30244719194a521
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Docker info

Client:
 Version:    26.1.1
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.14.0-desktop.1
    Path:     /Users/kristopherjohnson/.docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.27.0-desktop.2
    Path:     /Users/kristopherjohnson/.docker/cli-plugins/docker-compose
  debug: Get a shell into any image or container (Docker Inc.)
    Version:  0.0.29
    Path:     /Users/kristopherjohnson/.docker/cli-plugins/docker-debug
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.2
    Path:     /Users/kristopherjohnson/.docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.23
    Path:     /Users/kristopherjohnson/.docker/cli-plugins/docker-extension
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.4
    Path:     /Users/kristopherjohnson/.docker/cli-plugins/docker-feedback
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.1.0
    Path:     /Users/kristopherjohnson/.docker/cli-plugins/docker-init
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /Users/kristopherjohnson/.docker/cli-plugins/docker-sbom
  scout: Docker Scout (Docker Inc.)
    Version:  v1.8.0
    Path:     /Users/kristopherjohnson/.docker/cli-plugins/docker-scout

Server:
 Containers: 6
  Running: 0
  Paused: 0
  Stopped: 6
 Images: 43
 Server Version: 26.1.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: e377cd56a71523140ca6ae87e30244719194a521
 runc version: v1.1.12-0-g51d5e94
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
  cgroupns
 Kernel Version: 6.6.26-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: aarch64
 CPUs: 10
 Total Memory: 7.657GiB
 Name: docker-desktop
 ID: 71e08167-6ea6-4b63-ae72-0ac8f8d8e2a5
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Labels:
  com.docker.desktop.address=unix:///Users/kristopherjohnson/Library/Containers/com.docker.docker/Data/docker-cli.sock
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false

What happened?

Updated testcontainers package to latest:

go get -u github.com/testcontainers/testcontainers-go

Saw several dependencies update, including:

go: upgraded github.com/docker/docker v26.1.0+incompatible => v27.0.0+incompatible

Ran tests and received output in next section

Relevant log output

# github.com/testcontainers/testcontainers-go
../../go/pkg/mod/github.com/testcontainers/testcontainers-go@v0.31.0/docker.go:308:63: undefined: types.ImageRemoveOptions
../../go/pkg/mod/github.com/testcontainers/testcontainers-go@v0.31.0/docker.go:1071:21: undefined: types.ImagePullOptions
../../go/pkg/mod/github.com/testcontainers/testcontainers-go@v0.31.0/docker.go:1292:92: undefined: types.ImagePullOptions
../../go/pkg/mod/github.com/testcontainers/testcontainers-go@v0.31.0/docker.go:1431:3: unknown field CheckDuplicate in struct literal of type "github.com/docker/docker/api/types/network".CreateOptions
../../go/pkg/mod/github.com/testcontainers/testcontainers-go@v0.31.0/docker.go:1433:19: cannot use req.EnableIPv6 (variable of type bool) as *bool value in struct literal
../../go/pkg/mod/github.com/testcontainers/testcontainers-go@v0.31.0/docker.go:1601:50: undefined: types.ImageListOptions
../../go/pkg/mod/github.com/testcontainers/testcontainers-go@v0.31.0/docker.go:1644:48: undefined: types.ImagePullOptions

Additional information

Docker confirmed in this issue that v27.0.0 is a release candidate version accidentally tagged as a full version and that they should be releasing the actual full version (v27.0.1) sometime next week. With the errors given and the fact that the version is still a candidate for release, wanted to give testcontainers a heads up in case these changes are permanent.

Also, thank you for your amazing package!! It has been a blessing on our team and we truly appreciate all the effort the people behind this put in 🙇🏾

@KrazyK786 KrazyK786 added the bug An issue with the library label Jun 14, 2024
@thaJeztah
Copy link
Contributor

thaJeztah commented Jun 14, 2024

Hm. I think those types were marked as deprecated since v26.0.0, which added temporary aliases to point to the new location; https://github.com/moby/moby/blob/v26.0.0/api/types/types_deprecated.go#L7-L35 (and those are removed with the v27.xx release

@mdelapenya do you know if there's a linter in this repository that would check for those deprecations?

@thaJeztah
Copy link
Contributor

Ah, looks like this repo depends on v25.0.0, so yes, updating to two major versions ahead is somewhat expected to break things;

github.com/docker/docker v25.0.5+incompatible

I guess we can update it to v26.1, and adjust the code

@mdelapenya
Copy link
Member

@thaJeztah thanks for checking. Indeed, I'm going to bump docker version to v26.1 then.

@thaJeztah
Copy link
Contributor

I have a branch; pushing a PR now 😄

@thaJeztah
Copy link
Contributor

@mdelapenya #2584

@algorithmcardboard
Copy link

When will a new version with this fix be released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue with the library
Projects
None yet
4 participants