From 30277a8f806f6a30b88e008c30243681e9b03e44 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Mon, 16 Aug 2021 20:07:43 -0700 Subject: [PATCH 1/3] update go to 1.17.8 Removes the platform based switch between different versions. Signed-off-by: Tonis Tiigi Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 6119e4ba908c232e9fada67ff9685ec03802d38d) Signed-off-by: Sebastiaan van Stijn --- Dockerfile | 17 +++-------------- docker-bake.hcl | 3 +++ dockerfiles/Dockerfile.dev | 2 +- dockerfiles/Dockerfile.lint | 2 +- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index 57a566d301fa..0916a9aafb1e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,12 @@ # syntax=docker/dockerfile:1.3 ARG BASE_VARIANT=alpine -ARG GO_VERSION=1.16.15 +ARG GO_VERSION=1.17.8 ARG XX_VERSION=1.1.0 -FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-${BASE_VARIANT} AS gostable -FROM --platform=$BUILDPLATFORM golang:1.17rc1-${BASE_VARIANT} AS golatest - -FROM gostable AS go-linux -FROM gostable AS go-darwin -FROM gostable AS go-windows-amd64 -FROM gostable AS go-windows-386 -FROM gostable AS go-windows-arm -FROM golatest AS go-windows-arm64 -FROM go-windows-${TARGETARCH} AS go-windows - FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx -FROM go-${TARGETOS} AS build-base-alpine +FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-${BASE_VARIANT} AS build-base-alpine COPY --from=xx / / RUN apk add --no-cache clang lld llvm file git WORKDIR /go/src/github.com/docker/cli @@ -27,7 +16,7 @@ ARG TARGETPLATFORM # gcc is installed for libgcc only RUN xx-apk add --no-cache musl-dev gcc -FROM go-${TARGETOS} AS build-base-buster +FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-buster AS build-base-buster COPY --from=xx / / RUN apt-get update && apt-get install --no-install-recommends -y clang lld file WORKDIR /go/src/github.com/docker/cli diff --git a/docker-bake.hcl b/docker-bake.hcl index 909dd4fc189e..d2cfac938e65 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -1,3 +1,6 @@ +variable "GO_VERSION" { + default = "1.17.8" +} variable "VERSION" { default = "" } diff --git a/dockerfiles/Dockerfile.dev b/dockerfiles/Dockerfile.dev index cf8ab33c4864..77890df1636f 100644 --- a/dockerfiles/Dockerfile.dev +++ b/dockerfiles/Dockerfile.dev @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1.3 -ARG GO_VERSION=1.16.15 +ARG GO_VERSION=1.17.8 FROM golang:${GO_VERSION}-alpine AS golang ENV CGO_ENABLED=0 diff --git a/dockerfiles/Dockerfile.lint b/dockerfiles/Dockerfile.lint index e48fd23d788f..60599d121fb2 100644 --- a/dockerfiles/Dockerfile.lint +++ b/dockerfiles/Dockerfile.lint @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1.3 -ARG GO_VERSION=1.16.15 +ARG GO_VERSION=1.17.8 ARG GOLANGCI_LINTER_SHA="v1.21.0" FROM golang:${GO_VERSION}-alpine AS build From 3d4cc8e699a7496acfa9bd6f16348dd1992c1e31 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 14 Apr 2022 16:40:29 +0200 Subject: [PATCH 2/3] [20.10] update remaining files to go1.17.8 Signed-off-by: Sebastiaan van Stijn --- appveyor.yml | 2 +- dockerfiles/Dockerfile.binary-native | 2 +- dockerfiles/Dockerfile.e2e | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index af219dc3587e..3f0839aab5a3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,7 +4,7 @@ clone_folder: c:\gopath\src\github.com\docker\cli environment: GOPATH: c:\gopath - GOVERSION: 1.16.15 + GOVERSION: 1.17.8 DEPVERSION: v0.4.1 install: diff --git a/dockerfiles/Dockerfile.binary-native b/dockerfiles/Dockerfile.binary-native index ec98c77c8250..f78573302c01 100644 --- a/dockerfiles/Dockerfile.binary-native +++ b/dockerfiles/Dockerfile.binary-native @@ -1,4 +1,4 @@ -ARG GO_VERSION=1.16.15 +ARG GO_VERSION=1.17.8 FROM golang:${GO_VERSION}-alpine diff --git a/dockerfiles/Dockerfile.e2e b/dockerfiles/Dockerfile.e2e index 80602fba6874..af6a6269b4e8 100644 --- a/dockerfiles/Dockerfile.e2e +++ b/dockerfiles/Dockerfile.e2e @@ -1,4 +1,4 @@ -ARG GO_VERSION=1.16.15 +ARG GO_VERSION=1.17.8 # Use Debian based image as docker-compose requires glibc. FROM golang:${GO_VERSION}-buster From 80f673bf9e1968621ac70a6d16ae70ec9b51ea4c Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 26 Mar 2022 18:34:10 +0100 Subject: [PATCH 3/3] gofmt with go1.17 Signed-off-by: Sebastiaan van Stijn (cherry picked from commit a0f0578299905a607cf591cdb3d8608def655cfd) Signed-off-by: Sebastiaan van Stijn --- cli-plugins/manager/manager_unix.go | 1 + cli-plugins/manager/suffix_unix.go | 1 + cli/command/container/signals_unix.go | 1 + cli/command/container/signals_unix_test.go | 1 + cli/command/image/build/context_unix.go | 1 + cli/command/image/build/context_windows.go | 2 -- cli/config/configfile/file_unix.go | 1 + cli/config/credentials/default_store_unsupported.go | 1 + cli/connhelper/commandconn/commandconn_unix_test.go | 1 + cli/connhelper/commandconn/pdeathsig_nolinux.go | 1 + cli/connhelper/commandconn/session_unix.go | 1 + opts/hosts_unix.go | 1 + opts/hosts_windows.go | 2 -- 13 files changed, 11 insertions(+), 4 deletions(-) diff --git a/cli-plugins/manager/manager_unix.go b/cli-plugins/manager/manager_unix.go index f586acbd8da2..6aa5b9e5c4e6 100644 --- a/cli-plugins/manager/manager_unix.go +++ b/cli-plugins/manager/manager_unix.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package manager diff --git a/cli-plugins/manager/suffix_unix.go b/cli-plugins/manager/suffix_unix.go index 14f0903f40b7..afaf0007f5ab 100644 --- a/cli-plugins/manager/suffix_unix.go +++ b/cli-plugins/manager/suffix_unix.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package manager diff --git a/cli/command/container/signals_unix.go b/cli/command/container/signals_unix.go index 8db4cfe8353d..757abbf16e68 100644 --- a/cli/command/container/signals_unix.go +++ b/cli/command/container/signals_unix.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package container diff --git a/cli/command/container/signals_unix_test.go b/cli/command/container/signals_unix_test.go index 61ffe64a1cac..84f7f52be3a7 100644 --- a/cli/command/container/signals_unix_test.go +++ b/cli/command/container/signals_unix_test.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package container diff --git a/cli/command/image/build/context_unix.go b/cli/command/image/build/context_unix.go index cb2634f07954..5bf97c09f4e5 100644 --- a/cli/command/image/build/context_unix.go +++ b/cli/command/image/build/context_unix.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package build diff --git a/cli/command/image/build/context_windows.go b/cli/command/image/build/context_windows.go index c577cfa7be30..f127e5a14019 100644 --- a/cli/command/image/build/context_windows.go +++ b/cli/command/image/build/context_windows.go @@ -1,5 +1,3 @@ -// +build windows - package build import ( diff --git a/cli/config/configfile/file_unix.go b/cli/config/configfile/file_unix.go index 3ca65c6140d6..6af67181268a 100644 --- a/cli/config/configfile/file_unix.go +++ b/cli/config/configfile/file_unix.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package configfile diff --git a/cli/config/credentials/default_store_unsupported.go b/cli/config/credentials/default_store_unsupported.go index 3028168ac240..c9630ea51bad 100644 --- a/cli/config/credentials/default_store_unsupported.go +++ b/cli/config/credentials/default_store_unsupported.go @@ -1,3 +1,4 @@ +//go:build !windows && !darwin && !linux // +build !windows,!darwin,!linux package credentials diff --git a/cli/connhelper/commandconn/commandconn_unix_test.go b/cli/connhelper/commandconn/commandconn_unix_test.go index 18231b8f2a82..0103bcea2c7b 100644 --- a/cli/connhelper/commandconn/commandconn_unix_test.go +++ b/cli/connhelper/commandconn/commandconn_unix_test.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package commandconn diff --git a/cli/connhelper/commandconn/pdeathsig_nolinux.go b/cli/connhelper/commandconn/pdeathsig_nolinux.go index ab07166724f0..2adcf0816085 100644 --- a/cli/connhelper/commandconn/pdeathsig_nolinux.go +++ b/cli/connhelper/commandconn/pdeathsig_nolinux.go @@ -1,3 +1,4 @@ +//go:build !linux // +build !linux package commandconn diff --git a/cli/connhelper/commandconn/session_unix.go b/cli/connhelper/commandconn/session_unix.go index 6448500d6392..57bdecec03f2 100644 --- a/cli/connhelper/commandconn/session_unix.go +++ b/cli/connhelper/commandconn/session_unix.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package commandconn diff --git a/opts/hosts_unix.go b/opts/hosts_unix.go index 344b6c2e1be5..206834d4dd89 100644 --- a/opts/hosts_unix.go +++ b/opts/hosts_unix.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package opts diff --git a/opts/hosts_windows.go b/opts/hosts_windows.go index 97c6d857c2a8..1e42a2d776bc 100644 --- a/opts/hosts_windows.go +++ b/opts/hosts_windows.go @@ -1,5 +1,3 @@ -// +build windows - package opts // defaultHost constant defines the default host string used by docker on Windows