Skip to content

Conversation

@thaJeztah
Copy link
Member

CentOS 7 comes with a very old (1.8) version of git, which is not compatible
with go modules. We previously applied this fix to individual build scripts
for rootless-extras and the scan-cli-plugin, but now that other bits are
failing as well, lets move this to the Dockerfile for this distro, so that
for other distros we can use "direct" and fetch from GitHub.

Without this, the build of docker/cli (master branch) failed with:

+ ./scripts/vendor init
+ go mod edit -modfile=vendor.mod -require=github.com/cpuguy83/go-md2man/[email protected]
+ cp man/tools.go .
+ ./scripts/vendor update
+ go mod tidy -modfile=vendor.mod
go: github.com/theupdateframework/[email protected] requires
    github.com/docker/[email protected]: invalid pseudo-version: git fetch --unshallow -f origin in /go/pkg/mod/cache/vcs/48fbd2dfabec81f4c93170677bfc89087d4bec07a2d08f6ca5ce3d17962677ee: exit status 128:
    fatal: git fetch-pack: expected shallow list
make: *** [manpages] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.aKncVr (%build)

CentOS 7 comes with a very old (1.8) version of git, which is not compatible
with go modules. We previously applied this fix to individual build scripts
for rootless-extras and the scan-cli-plugin, but now that other bits are
failing as well, lets move this to the Dockerfile for this distro, so that
for other distros we can use "direct" and fetch from GitHub.

Without this, the build of docker/cli (master branch) failed with:

    + ./scripts/vendor init
    + go mod edit -modfile=vendor.mod -require=github.com/cpuguy83/go-md2man/[email protected]
    + cp man/tools.go .
    + ./scripts/vendor update
    + go mod tidy -modfile=vendor.mod
    go: github.com/theupdateframework/[email protected] requires
        github.com/docker/[email protected]: invalid pseudo-version: git fetch --unshallow -f origin in /go/pkg/mod/cache/vcs/48fbd2dfabec81f4c93170677bfc89087d4bec07a2d08f6ca5ce3d17962677ee: exit status 128:
        fatal: git fetch-pack: expected shallow list
    make: *** [manpages] Error 1
    error: Bad exit status from /var/tmp/rpm-tmp.aKncVr (%build)

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah
Copy link
Member Author

LOL... and now some random failure on debian buster;

+ go mod tidy -modfile=vendor.mod
go: github.com/containerd/[email protected] requires
	github.com/containerd/[email protected] requires
	github.com/containerd/[email protected] requires
	github.com/Microsoft/[email protected] requires
	github.com/containerd/[email protected] requires
	github.com/Microsoft/hcsshim/[email protected] requires
	github.com/Microsoft/[email protected] requires
	k8s.io/[email protected]: unrecognized import path "k8s.io/kubernetes": https fetch: Get "https://k8s.io/kubernetes?go-get=1": read tcp 172.17.0.2:51160->34.107.204.206:443: read: connection reset by peer

@thaJeztah
Copy link
Member Author

Alternative to #633

@thaJeztah thaJeztah merged commit cee73ce into docker:master Mar 7, 2022
@thaJeztah thaJeztah deleted the centos_module_fix branch March 7, 2022 17:35
@thaJeztah thaJeztah changed the title CentOS 7: use go-proxy to work around old git version [master] CentOS 7: use go-proxy to work around old git version Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants