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

Closed
Togtja opened this issue Oct 24, 2022 · 2 comments
Closed

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

Togtja opened this issue Oct 24, 2022 · 2 comments

Comments

@Togtja
Copy link

Togtja commented Oct 24, 2022

Description

Hi, I am getting an import error when importing github.com/docker/compose/v2/pkg/compose after build.go (#9925) switched to github.com/docker/docker/builder/remotecontext/urlutil

$ go mod tidy
go: finding module for package github.com/docker/docker/builder/remotecontext/urlutil
docker-compose imports
        github.com/docker/compose/v2/pkg/compose imports
        github.com/docker/docker/builder/remotecontext/urlutil: module github.com/docker/docker@latest found (v20.10.20+incompatible), but does not contain package github.com/docker/docker/builder/remotecontext/urlutil

Steps To Reproduce

  1. Create a go project that imports github.com/docker/compose/v2/pkg/compose
  2. Call go mod tidy

Compose Version

github.com/docker/compose/v2 v2.12.2

Docker Environment

github.com/docker/docker v20.10.20+incompatible

Anything else?

No response

@glours
Copy link
Contributor

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
@Togtja
Copy link
Author

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
Projects
None yet
Development

No branches or pull requests

2 participants