Skip to content

Commit

Permalink
Merge pull request #747 from thaJeztah/20.10_backport_less_goproxy_hacks
Browse files Browse the repository at this point in the history
[20.10 backport] Update GOPROXY to use default with fallback
  • Loading branch information
thaJeztah committed Aug 20, 2022
2 parents 222b074 + 654c7cc commit 49a93e4
Show file tree
Hide file tree
Showing 18 changed files with 18 additions and 28 deletions.
1 change: 0 additions & 1 deletion deb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ BUILD?=DOCKER_BUILDKIT=1 \
RUN_FLAGS=
RUN?=docker run --rm \
-e PLATFORM \
-e GOPROXY=https://proxy.golang.org \
-e EPOCH='$(EPOCH)' \
-e DEB_VERSION=$(word 1, $(GEN_DEB_VER)) \
-e VERSION=$(word 2, $(GEN_DEB_VER)) \
Expand Down
6 changes: 2 additions & 4 deletions deb/common/rules
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ override_dh_auto_build:
LDFLAGS='' DISABLE_WARN_OUTSIDE_CONTAINER=1 make VERSION=$(VERSION) GITCOMMIT=$(CLI_GITCOMMIT) dynbinary manpages

# Build the compose plugin
# FIXME: using GOPROXY, to work around:
# go: github.com/Azure/azure-sdk-for-go@v48.2.0+incompatible: reading github.com/Azure/azure-sdk-for-go/go.mod at revision v48.2.0: unknown revision v48.2.0
cd /go/src/github.com/docker/compose \
&& GOPROXY="https://proxy.golang.org" GO111MODULE=on go mod download \
&& GO111MODULE=on go mod download \
&& mkdir -p /usr/libexec/docker/cli-plugins/ \
&& GOPROXY="https://proxy.golang.org" GO111MODULE=on \
&& GO111MODULE=on \
CGO_ENABLED=0 \
go build \
-trimpath \
Expand Down
2 changes: 1 addition & 1 deletion deb/debian-bullseye/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ FROM ${BUILD_IMAGE}
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y curl devscripts equivs git

ENV GOPROXY=direct
ENV GOPROXY=https://proxy.golang.org|direct
ENV GO111MODULE=off
ENV GOPATH /go
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
Expand Down
2 changes: 1 addition & 1 deletion deb/debian-buster/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ FROM ${BUILD_IMAGE}
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y curl devscripts equivs git

ENV GOPROXY=direct
ENV GOPROXY=https://proxy.golang.org|direct
ENV GO111MODULE=off
ENV GOPATH /go
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
Expand Down
2 changes: 1 addition & 1 deletion deb/raspbian-bullseye/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ FROM ${BUILD_IMAGE}
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y curl devscripts equivs git

ENV GOPROXY=direct
ENV GOPROXY=https://proxy.golang.org|direct
ENV GO111MODULE=off
ENV GOPATH /go
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
Expand Down
2 changes: 1 addition & 1 deletion deb/raspbian-buster/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ FROM ${BUILD_IMAGE}
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y curl devscripts equivs git

ENV GOPROXY=direct
ENV GOPROXY=https://proxy.golang.org|direct
ENV GO111MODULE=off
ENV GOPATH /go
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
Expand Down
2 changes: 1 addition & 1 deletion deb/ubuntu-bionic/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ FROM ${BUILD_IMAGE}
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y curl devscripts equivs git

ENV GOPROXY=direct
ENV GOPROXY=https://proxy.golang.org|direct
ENV GO111MODULE=off
ENV GOPATH /go
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
Expand Down
2 changes: 1 addition & 1 deletion deb/ubuntu-focal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN if [ "$(dpkg-divert --truename /usr/bin/man)" = "/usr/bin/man.REAL" ]; then
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y curl devscripts equivs git

ENV GOPROXY=direct
ENV GOPROXY=https://proxy.golang.org|direct
ENV GO111MODULE=off
ENV GOPATH /go
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
Expand Down
2 changes: 1 addition & 1 deletion deb/ubuntu-jammy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN if [ "$(dpkg-divert --truename /usr/bin/man)" = "/usr/bin/man.REAL" ]; then
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y curl devscripts equivs git

ENV GOPROXY=direct
ENV GOPROXY=https://proxy.golang.org|direct
ENV GO111MODULE=off
ENV GOPATH /go
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
Expand Down
1 change: 0 additions & 1 deletion rpm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ RPMBUILD_FLAGS?=-ba\
RUN_FLAGS=
RUN?=docker run --rm \
-e PLATFORM \
-e GOPROXY=https://proxy.golang.org \
-v $(CURDIR)/rpmbuild/SOURCES:/root/rpmbuild/SOURCES:ro \
-v $(CURDIR)/rpmbuild/$@/RPMS:/root/rpmbuild/RPMS \
-v $(CURDIR)/rpmbuild/$@/SRPMS:/root/rpmbuild/SRPMS \
Expand Down
6 changes: 2 additions & 4 deletions rpm/SPECS/docker-compose-plugin.spec
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ Docker Compose V1 ('docker-compose').

%build
pushd ${RPM_BUILD_DIR}/src/compose
# FIXME: using GOPROXY, to work around:
# go: github.com/Azure/azure-sdk-for-go@v48.2.0+incompatible: reading github.com/Azure/azure-sdk-for-go/go.mod at revision v48.2.0: unknown revision v48.2.0
GOPROXY="https://proxy.golang.org" GO111MODULE=on go mod download
GOPROXY="https://proxy.golang.org" GO111MODULE=on \
GO111MODULE=on go mod download
GO111MODULE=on \
CGO_ENABLED=0 \
go build \
-trimpath \
Expand Down
6 changes: 1 addition & 5 deletions rpm/centos-7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ FROM ${GO_IMAGE} AS golang

FROM ${BUILD_IMAGE}

# Using goproxy instead of "direct" to work around an issue in go mod
# not working with older git versions (default version on CentOS 7 is
# git 1.8), see https://github.com/golang/go/issues/38373, and
# https://github.com/docker/docker-ce-packaging/pull/631#issuecomment-1059363763
ENV GOPROXY=https://proxy.golang.org
ENV GOPROXY=https://proxy.golang.org|direct
ENV GO111MODULE=off
ENV GOPATH=/go
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
Expand Down
2 changes: 1 addition & 1 deletion rpm/centos-8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG BUILD_IMAGE=quay.io/centos/${DISTRO}:stream${SUITE}
FROM ${GO_IMAGE} AS golang

FROM ${BUILD_IMAGE}
ENV GOPROXY=direct
ENV GOPROXY=https://proxy.golang.org|direct
ENV GO111MODULE=off
ENV GOPATH=/go
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
Expand Down
2 changes: 1 addition & 1 deletion rpm/centos-9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG BUILD_IMAGE=quay.io/centos/${DISTRO}:stream${SUITE}
FROM ${GO_IMAGE} AS golang

FROM ${BUILD_IMAGE}
ENV GOPROXY=direct
ENV GOPROXY=https://proxy.golang.org|direct
ENV GO111MODULE=off
ENV GOPATH=/go
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
Expand Down
2 changes: 1 addition & 1 deletion rpm/fedora-35/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG BUILD_IMAGE=${DISTRO}:${SUITE}
FROM ${GO_IMAGE} AS golang

FROM ${BUILD_IMAGE}
ENV GOPROXY=direct
ENV GOPROXY=https://proxy.golang.org|direct
ENV GO111MODULE=off
ENV GOPATH /go
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
Expand Down
2 changes: 1 addition & 1 deletion rpm/fedora-36/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG BUILD_IMAGE=${DISTRO}:${SUITE}
FROM ${GO_IMAGE} AS golang

FROM ${BUILD_IMAGE}
ENV GOPROXY=direct
ENV GOPROXY=https://proxy.golang.org|direct
ENV GO111MODULE=off
ENV GOPATH /go
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
Expand Down
2 changes: 1 addition & 1 deletion rpm/fedora-37/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG BUILD_IMAGE=${DISTRO}:${SUITE}
FROM ${GO_IMAGE} AS golang

FROM ${BUILD_IMAGE}
ENV GOPROXY=direct
ENV GOPROXY=https://proxy.golang.org|direct
ENV GO111MODULE=off
ENV GOPATH /go
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
Expand Down
2 changes: 1 addition & 1 deletion rpm/rhel-7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG BUILD_IMAGE=dockereng/${DISTRO}:${SUITE}-s390x
FROM ${GO_IMAGE} AS golang

FROM ${BUILD_IMAGE}
ENV GOPROXY=direct
ENV GOPROXY=https://proxy.golang.org|direct
ENV GO111MODULE=off
ENV GOPATH=/go
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
Expand Down

0 comments on commit 49a93e4

Please sign in to comment.