[build] cmd/coordinator: update Dockerfile to Go 1.17

192 views
Skip to first unread message

Alexander Rakoczy (Gerrit)

unread,
Sep 10, 2021, 4:46:05 PM9/10/21
to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Go Bot, Dmitri Shuralyov, Heschi Kreinick, Ian Lance Taylor, golang-co...@googlegroups.com

Alexander Rakoczy submitted this change.

View Change



2 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:

```
The name of the file: cmd/coordinator/Dockerfile
Insertions: 3, Deletions: 1.

@@ -13,11 +13,13 @@

WORKDIR /go/src/golang.org/x/build

+# Download module dependencies to improve speed of re-building the
+# Docker image during minor code changes.
RUN go mod download

# Makefile passes a string with --build-arg version
# This becomes part of the cache key for all subsequent instructions,
-# so it must not be placed above the "go install" commands above.
+# so it must not be placed above the "go mod download" command above.
ARG version=unknown

# TODO: ideally we'd first copy all of x/build here EXCEPT
```

Approvals: Dmitri Shuralyov: Looks good to me, approved Heschi Kreinick: Looks good to me, approved Alexander Rakoczy: Trusted; Run TryBots Go Bot: TryBots succeeded
cmd/coordinator: update Dockerfile to Go 1.17

This updates the coordinator to the latest supported version of Go. The
current version of Go labeled golang:1.17 is 1.17.1.

Use go mod download instead of manually trying to install dependencies
because it's easier to maintain and fast enough for our current needs.
Also, use the correct label syntax.

For golang/go#48329

Change-Id: I3db030624c1be12008705f374b269bc92e60ab25
Reviewed-on: https://go-review.googlesource.com/c/build/+/349091
Trust: Alexander Rakoczy <al...@golang.org>
Run-TryBot: Alexander Rakoczy <al...@golang.org>
TryBot-Result: Go Bot <go...@golang.org>
Reviewed-by: Dmitri Shuralyov <dmit...@golang.org>
Reviewed-by: Heschi Kreinick <hes...@google.com>
---
M cmd/coordinator/Dockerfile
1 file changed, 6 insertions(+), 28 deletions(-)

diff --git a/cmd/coordinator/Dockerfile b/cmd/coordinator/Dockerfile
index 09e7b15..e0dcf9c 100644
--- a/cmd/coordinator/Dockerfile
+++ b/cmd/coordinator/Dockerfile
@@ -2,8 +2,8 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

-FROM golang:1.16 AS build
-LABEL maintainer "golan...@googlegroups.com"
+FROM golang:1.17 AS build
+LABEL maintainer="golan...@googlegroups.com"

RUN mkdir /gocache
ENV GOCACHE /gocache
@@ -13,35 +13,13 @@

WORKDIR /go/src/golang.org/x/build

-# Optimization for iterative docker build speed, not necessary for correctness:
-# TODO: write a tool to make writing Go module-friendly Dockerfiles easier.
-RUN go install \
- cloud.google.com/go/compute/metadata \
- cloud.google.com/go/datastore \
- cloud.google.com/go/errorreporting \
- cloud.google.com/go/storage \
- github.com/gliderlabs/ssh \
- github.com/golang/protobuf/ptypes \
- github.com/kr/pty \
- go4.org/syncutil \
- golang.org/x/crypto/acme/autocert \
- golang.org/x/crypto/ssh \
- golang.org/x/oauth2 \
- golang.org/x/oauth2/google \
- golang.org/x/perf/storage \
- golang.org/x/time/rate \
- google.golang.org/api/compute/v1 \
- google.golang.org/api/container/v1 \
- google.golang.org/api/googleapi \
- google.golang.org/genproto/googleapis/api/metric \
- google.golang.org/genproto/googleapis/monitoring/v3 \
- gopkg.in/inf.v0 \
- grpc.go4.org \
- && true
+# Download module dependencies to improve speed of re-building the
+# Docker image during minor code changes.
+RUN go mod download

# Makefile passes a string with --build-arg version
# This becomes part of the cache key for all subsequent instructions,
-# so it must not be placed above the "go install" commands above.
+# so it must not be placed above the "go mod download" command above.
ARG version=unknown

# TODO: ideally we'd first copy all of x/build here EXCEPT

To view, visit change 349091. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: build
Gerrit-Branch: master
Gerrit-Change-Id: I3db030624c1be12008705f374b269bc92e60ab25
Gerrit-Change-Number: 349091
Gerrit-PatchSet: 5
Gerrit-Owner: Alexander Rakoczy <al...@golang.org>
Gerrit-Reviewer: Alexander Rakoczy <al...@golang.org>
Gerrit-Reviewer: Dmitri Shuralyov <dmit...@golang.org>
Gerrit-Reviewer: Go Bot <go...@golang.org>
Gerrit-Reviewer: Heschi Kreinick <hes...@google.com>
Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
Gerrit-MessageType: merged
Reply all
Reply to author
Forward
0 new messages