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] Importing pkg/compose in go causes error #9946

Togtja opened this issue Oct 24, 2022 · 2 comments

[BUG] Importing pkg/compose in go causes error #9946

Togtja opened this issue Oct 24, 2022 · 2 comments


Copy link

Togtja commented Oct 24, 2022


Hi, I am getting an import error when importing after build.go (#9925) switched to

$ go mod tidy
go: finding module for package
docker-compose imports imports module found (v20.10.20+incompatible), but does not contain package

Steps To Reproduce

  1. Create a go project that imports
  2. Call go mod tidy

Compose Version v2.12.2

Docker Environment v20.10.20+incompatible

Anything else?

No response

Copy link

glours commented Oct 24, 2022

If you look at compose go.mod file there is a replace section that changes the version used for the docker api, we're not based on the latest version of the API but on the next coming one 22.06 so you should add a the same replace rule in your go.mod

Let me know if you have any issues after applying this rule

@glours glours self-assigned this Oct 24, 2022
Copy link

Togtja commented Oct 24, 2022

Thank you so much.
Adding the replace did the trick

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants