Skip to content

Commit 52dbde8

Browse files
committed
cmd/{gitmirror,pubsubhelper,gitlock}: use go modules, delete gitlock
This removes the last two gitlock users, so this also deletes gitlock. And update to multi-stage Dockerfiles, simplifying the build and making it more consistent with others. Updates golang/go#26872 Change-Id: I1e38c65eccfe9b8b7cb2d9acd6eb02aa33f8b877 Reviewed-on: https://go-review.googlesource.com/c/build/+/176604 Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Andrew Bonventre <[email protected]>
1 parent 93d00f7 commit 52dbde8

File tree

9 files changed

+74
-417
lines changed

9 files changed

+74
-417
lines changed

cmd/gitlock/README.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

cmd/gitlock/gitlock.go

Lines changed: 0 additions & 199 deletions
This file was deleted.

cmd/gitmirror/Dockerfile

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,40 @@
11
# Copyright 2017 The Go Authors. All rights reserved.
22
# Use of this source code is governed by a BSD-style
33
# license that can be found in the LICENSE file.
4-
FROM debian:jessie
4+
5+
FROM golang:1.12 AS build
6+
LABEL maintainer "[email protected]"
7+
8+
ENV GO111MODULE=on
9+
ENV GOPROXY=https://proxy.golang.org
10+
11+
RUN mkdir /gocache
12+
ENV GOCACHE /gocache
13+
14+
COPY go.mod /go/src/golang.org/x/build/go.mod
15+
COPY go.sum /go/src/golang.org/x/build/go.sum
16+
17+
WORKDIR /go/src/golang.org/x/build
18+
19+
# Optimization for iterative docker build speed, not necessary for correctness:
20+
# TODO: write a tool to make writing Go module-friendly Dockerfiles easier.
21+
RUN go install cloud.google.com/go/compute/metadata
22+
COPY gerrit /go/src/golang.org/x/build/gerrit
23+
RUN go install golang.org/x/build/gerrit
24+
COPY buildenv /go/src/golang.org/x/build/buildenv
25+
RUN go install golang.org/x/build/buildenv
26+
COPY maintner /go/src/golang.org/x/build/maintner
27+
COPY cmd/pubsubhelper /go/src/golang.org/x/build/cmd/pubsubhelper
28+
RUN go install golang.org/x/build/maintner/maintnerd/apipb
29+
RUN go install golang.org/x/build/maintner/godata
30+
31+
COPY . /go/src/golang.org/x/build/
32+
WORKDIR /go/src/golang.org/x/build/
33+
34+
COPY . /go/src/golang.org/x/build/
35+
RUN go install golang.org/x/build/cmd/gitmirror
36+
37+
FROM debian:stretch
538
LABEL maintainer "[email protected]"
639

740
# For interacting with the Go source & subrepos
@@ -10,7 +43,7 @@ RUN apt-get update && apt-get install -y \
1043
ca-certificates \
1144
git-core \
1245
openssh-client \
13-
gnupg \
46+
gnupg dirmngr \
1447
&& rm -rf /var/lib/apt/lists/*
1548

1649
# See https://github.com/golang/go/issues/23705
@@ -30,5 +63,5 @@ RUN mkdir -p ~/.ssh/ \
3063
&& echo "|1|HygGkfOGLovavKfixjXWFJ7Yk1I=|lb/724row8KDTMC1dZiJlHyjxWM= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==" >> ~/.ssh/known_hosts \
3164
&& chmod 0600 ~/.ssh/known_hosts
3265

33-
COPY gitmirror /
66+
COPY --from=build /go/bin/gitmirror /
3467
ENTRYPOINT ["/tini", "--", "/gitmirror"]

cmd/gitmirror/Dockerfile.0

Lines changed: 0 additions & 96 deletions
This file was deleted.

0 commit comments

Comments
 (0)