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]: Import issue on v0.17.0 #708

Closed
etiennedi opened this issue Dec 23, 2022 · 3 comments
Closed

[Bug]: Import issue on v0.17.0 #708

etiennedi opened this issue Dec 23, 2022 · 3 comments
Labels
bug An issue with the library

Comments

@etiennedi
Copy link

etiennedi commented Dec 23, 2022

Testcontainers version

0.17.0

Using the latest Testcontainers version?

Yes

Host OS

Darwin

Host arch

ARM64

Go version

1.19.4

Docker version

Client:
 Cloud integration: v1.0.22
 Version:           20.10.11
 API version:       1.41
 Go version:        go1.16.10
 Git commit:        dea9396
 Built:             Thu Nov 18 00:36:09 2021
 OS/Arch:           darwin/arm64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.11
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.9
  Git commit:       847da18
  Built:            Thu Nov 18 00:34:44 2021
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.4.12
  GitCommit:        7b11cfaabd73bb80907dd23182b9347b4245eb5d
 runc:
  Version:          1.0.2
  GitCommit:        v1.0.2-0-g52b36a2
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Docker info

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.7.1)
  compose: Docker Compose (Docker Inc., v2.2.1)
  scan: Docker Scan (Docker Inc., 0.9.0)

Server:
 Containers: 230
  Running: 1
  Paused: 0
  Stopped: 229
 Images: 208
 Server Version: 20.10.11
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  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 logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runtime.v1.linux runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 7b11cfaabd73bb80907dd23182b9347b4245eb5d
 runc version: v1.0.2-0-g52b36a2
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.10.76-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: aarch64
 CPUs: 8
 Total Memory: 29.34GiB
 Name: docker-desktop
 ID: MAL3:HBOH:3DJN:IH56:BBPV:WC54:CPT5:MZAT:JBEX:5S34:M6AS:G5II
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

What happened?

Repro

  1. Create a new project
  2. Create a file main.go with the contents below
  3. go run main.go

Contents of main.go

package main

import (
	_ "github.com/testcontainers/testcontainers-go"
)

func main() {
}

Expected

compiles

Actual

Does not compile:

vendor/github.com/testcontainers/testcontainers-go/docker.go:220:24: undefined: container.StopOptions

Relevant log output

No response

Additional information

go.mod:

module upgrade-journey

go 1.19

require github.com/testcontainers/testcontainers-go v0.17.0

require (
        github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
        github.com/Microsoft/go-winio v0.6.0 // indirect
        github.com/Microsoft/hcsshim v0.9.6 // indirect
        github.com/cenkalti/backoff/v4 v4.2.0 // indirect
        github.com/containerd/cgroups v1.0.4 // indirect
        github.com/containerd/containerd v1.6.14 // indirect
        github.com/docker/distribution v2.8.1+incompatible // indirect
        github.com/docker/docker v20.10.22+incompatible // indirect
        github.com/docker/go-connections v0.4.0 // indirect
        github.com/docker/go-units v0.5.0 // indirect
        github.com/gogo/protobuf v1.3.2 // indirect
        github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
        github.com/golang/protobuf v1.5.2 // indirect
        github.com/google/uuid v1.3.0 // indirect
        github.com/magiconair/properties v1.8.7 // indirect
        github.com/moby/sys/mount v0.3.3 // indirect
        github.com/moby/sys/mountinfo v0.6.2 // indirect
        github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect
        github.com/morikuni/aec v1.0.0 // indirect
        github.com/opencontainers/go-digest v1.0.0 // indirect
        github.com/opencontainers/image-spec v1.1.0-rc2 // indirect
        github.com/opencontainers/runc v1.1.4 // indirect
        github.com/pkg/errors v0.9.1 // indirect
        github.com/sirupsen/logrus v1.9.0 // indirect
        go.opencensus.io v0.24.0 // indirect
        golang.org/x/mod v0.7.0 // indirect
        golang.org/x/net v0.4.0 // indirect
        golang.org/x/sys v0.3.0 // indirect
        golang.org/x/tools v0.4.0 // indirect
        google.golang.org/genproto v0.0.0-20221207170731-23e4bf6bdc37 // indirect
        google.golang.org/grpc v1.51.0 // indirect
        google.golang.org/protobuf v1.28.1 // indirect
)
@etiennedi etiennedi added the bug An issue with the library label Dec 23, 2022
@mdelapenya
Copy link
Collaborator

mdelapenya commented Dec 23, 2022

Hey @etiennedi there is a disclaimer message in the release notes about the docker dependency: https://github.com/testcontainers/testcontainers-go/releases/tag/v0.17.0

⚠️ Breaking Changes

Given the amount of issues after #476, causing consumers of this library to update their dependencies with multiple replace directives in their go.mod files, we have moved compose code to a separate module. Therefore the majority of the users of the library will only need to replace Docker dependency with the one used in this library, which is simpler in terms of usage. Please see Install instructions for further information.

replace (
	github.com/docker/docker => github.com/docker/docker v20.10.3-0.20221013203545-33ab36d6b304+incompatible // 22.06 branch
)

On the other hand, users of native Docker Compose code will still need all the replace directives, as described in the Compose docs.

Did you check it?

@etiennedi
Copy link
Author

I can confirm that it compiles when adding the replace directive. Thanks for the quick response. I interpreted the release notes that the replace is no longer needed. Adding it fixed it. Closing.

@mdelapenya
Copy link
Collaborator

Thanks for your patience 🙏 In this 0.17.0 release we are trying to reduce the amount of replace directives caused by the native docker compose support.

If you consider the message is not clear enough, please feel free to contribute a fix to the docs and/or markdown files.

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
Development

No branches or pull requests

2 participants