Skip to content

Commit

Permalink
hack: use GOPROXY for rootlesskit to workaround issue with old git on…
Browse files Browse the repository at this point in the history
… 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 <tibor@docker.com>
  • Loading branch information
Tibor Vass committed Mar 23, 2021
1 parent dc4a600 commit cbc6cef
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hack/dockerfile/install/rootlesskit.installer
Expand Up @@ -31,6 +31,11 @@ _install_rootlesskit() (
cd "$GOPATH/src/github.com/rootless-containers/rootlesskit" || exit 1
git checkout -q "$ROOTLESSKIT_COMMIT"
export GO111MODULE=on
# TODO remove GOPROXY override once we updated to Go 1.14+
# Using goproxy instead of "direct" to work around an issue in go mod
# on Go 1.13 not working with older git versions (default version on
# CentOS 7 is git 1.8), see https://github.com/golang/go/issues/38373
export GOPROXY="https://proxy.golang.org"
for f in rootlesskit rootlesskit-docker-proxy; do
go build $BUILD_MODE -ldflags="$ROOTLESSKIT_LDFLAGS" -o "${PREFIX}/$f" github.com/rootless-containers/rootlesskit/cmd/$f
done
Expand Down

0 comments on commit cbc6cef

Please sign in to comment.