Skip to content

Commit d1ee5a7

Browse files
Tibor Vassnosamad
Tibor Vass
authored andcommitted
hack: use GOPROXY for rootlesskit to workaround issue with old git on CentOS/RHEL 7
Since rootlesskit removed vendor folder, building it has to rely on go mod. Dockerfile in docker-ce-packaging uses GOPROXY=direct, which makes "go mod" commands use git to fetch modules. "go mod" in Go versions before 1.14.1 are incompatible with older git versions, including the version of git that ships with CentOS/RHEL 7 (which have git 1.8), see golang/go#38373 This patch switches rootlesskit install script to set GOPROXY to https://proxy.golang.org so that git is not required for downloading modules. Once all our code has upgraded to Go 1.14+, this workaround should be removed. Signed-off-by: Tibor Vass <[email protected]> (cherry picked from commit cbc6cef) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent f199b94 commit d1ee5a7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

hack/dockerfile/install/rootlesskit.installer

+5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ _install_rootlesskit() (
3131
cd "$GOPATH/src/github.com/rootless-containers/rootlesskit" || exit 1
3232
git checkout -q "$ROOTLESSKIT_COMMIT"
3333
export GO111MODULE=on
34+
# TODO remove GOPROXY override once we updated to Go 1.14+
35+
# Using goproxy instead of "direct" to work around an issue in go mod
36+
# on Go 1.13 not working with older git versions (default version on
37+
# CentOS 7 is git 1.8), see https://github.com/golang/go/issues/38373
38+
export GOPROXY="https://proxy.golang.org"
3439
for f in rootlesskit rootlesskit-docker-proxy; do
3540
go build $BUILD_MODE -ldflags="$ROOTLESSKIT_LDFLAGS" -o "${PREFIX}/$f" github.com/rootless-containers/rootlesskit/cmd/$f
3641
done

0 commit comments

Comments
 (0)