1
1
# Copyright 2017 The Go Authors. All rights reserved.
2
2
# Use of this source code is governed by a BSD-style
3
3
# 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
5
38
LABEL maintainer
"[email protected] "
6
39
7
40
# For interacting with the Go source & subrepos
@@ -10,7 +43,7 @@ RUN apt-get update && apt-get install -y \
10
43
ca-certificates \
11
44
git-core \
12
45
openssh-client \
13
- gnupg \
46
+ gnupg dirmngr \
14
47
&& rm -rf /var/lib/apt/lists/*
15
48
16
49
# See https://github.com/golang/go/issues/23705
@@ -30,5 +63,5 @@ RUN mkdir -p ~/.ssh/ \
30
63
&& echo "|1|HygGkfOGLovavKfixjXWFJ7Yk1I=|lb/724row8KDTMC1dZiJlHyjxWM= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==" >> ~/.ssh/known_hosts \
31
64
&& chmod 0600 ~/.ssh/known_hosts
32
65
33
- COPY gitmirror /
66
+ COPY --from=build /go/bin/ gitmirror /
34
67
ENTRYPOINT ["/tini" , "--" , "/gitmirror" ]
0 commit comments