Skip to content

[20.10 backport] CentOS 7: use go-proxy to work around old git version#636

Merged
thaJeztah merged 1 commit into
docker:20.10from
thaJeztah:20.10_backport_centos_module_fix
Mar 7, 2022
Merged

[20.10 backport] CentOS 7: use go-proxy to work around old git version#636
thaJeztah merged 1 commit into
docker:20.10from
thaJeztah:20.10_backport_centos_module_fix

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

backport of #635 for the 20.10 branch. Not strictly needed currently, but just in case go modules acts up again 🤣

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/v2@v2.0.1
+ cp man/tools.go .
+ ./scripts/vendor update
+ go mod tidy -modfile=vendor.mod
go: github.com/theupdateframework/notary@v0.7.1-0.20210315103452-bf96a202a09a requires
    github.com/docker/go@v1.5.1-1.0.20160303222718-d30aec9fd63c: 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/v2@v2.0.1
    + cp man/tools.go .
    + ./scripts/vendor update
    + go mod tidy -modfile=vendor.mod
    go: github.com/theupdateframework/notary@v0.7.1-0.20210315103452-bf96a202a09a requires
        github.com/docker/go@v1.5.1-1.0.20160303222718-d30aec9fd63c: 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 <github@gone.nl>
(cherry picked from commit f99dd93)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah merged commit b852e9c into docker:20.10 Mar 7, 2022
@thaJeztah thaJeztah deleted the 20.10_backport_centos_module_fix branch March 7, 2022 17:37
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