Skip to content

go mod friendly #3031

@rcgoodfellow

Description

@rcgoodfellow

https://github.com/containerd Subproject checklist (EDIT: added by @AkihiroSuda )


Description

Containerd currently causes issues for downstream projects using go mod. Since this is the official Go dependency management tool now, support would be nice.

Steps to reproduce the issue:

  1. Import containerd from a project using go mod for dependency management.
  2. Build the project

Describe the results you received:
Does not build. Specifically due to the following.

# github.com/containerd/containerd/images/archive
/home/ry/go/pkg/mod/github.com/containerd/containerd@v1.2.4/images/archive/reference.go:72:21: undefined: reference.ParseDockerRef

Module based builds were actually working fine until this commit ed756ff which introduced a dependency on code that is only in the master branch of docker/distribution.

As a workaround we currently use

replace github.com/docker/distribution v2.7.1+incompatible => github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible

in our go.mod file. But this is not really maintainable and also slows down built time significantly as it requires re-download of certain modules on every build.

Describe the results you expected:

Project builds.

Output of containerd --version:

containerd github.com/containerd/containerd v1.2.2 9754871865f7fe2f4e74d43e2fc7ccd237edcbce

Thanks

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions