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
5
6
LABEL maintainer
"[email protected] "
6
7
7
- # openssh client is for the gomote ssh proxy client.
8
- # telnet is for the gomote ssh proxy to windows. (no ssh server there)
9
- # git-core, make, gcc, libc6-dev, and libx11-dev are to build 0intro/conterm,
10
- # used to connect to plan9 instances.
11
- RUN apt-get update && apt-get install -y \
12
- --no-install-recommends \
13
- ca-certificates \
14
- openssh-client \
15
- telnet \
16
- git-core make gcc libc6-dev libx11-dev \
17
- && rm -rf /var/lib/apt/lists/*
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 \
22
+ cloud.google.com/go/compute/metadata \
23
+ cloud.google.com/go/datastore \
24
+ cloud.google.com/go/errorreporting \
25
+ cloud.google.com/go/monitoring/apiv3 \
26
+ cloud.google.com/go/storage \
27
+ github.com/gliderlabs/ssh \
28
+ github.com/golang/protobuf/ptypes \
29
+ github.com/kr/pty \
30
+ go4.org/syncutil \
31
+ golang.org/x/crypto/acme/autocert \
32
+ golang.org/x/crypto/ssh \
33
+ golang.org/x/oauth2 \
34
+ golang.org/x/oauth2/google \
35
+ golang.org/x/perf/storage \
36
+ golang.org/x/time/rate \
37
+ google.golang.org/api/compute/v1 \
38
+ google.golang.org/api/container/v1 \
39
+ google.golang.org/api/googleapi \
40
+ google.golang.org/genproto/googleapis/api/metric \
41
+ google.golang.org/genproto/googleapis/monitoring/v3 \
42
+ gopkg.in/inf.v0 \
43
+ grpc.go4.org \
44
+ && true
45
+
46
+ # Makefile passes a string with --build-arg version
47
+ # This becomes part of the cache key for all subsequent instructions,
48
+ # so it must not be placed above the "go install" commands above.
49
+ ARG version=unknown
50
+
51
+ # TODO: ideally we'd first copy all of x/build here EXCEPT
52
+ # cmd/coordinator, then build x/build/..., and *then* COPY in the
53
+ # cmd/coordinator files and then build the final binary. Currently we
54
+ # do too much building of x/build/foo stuff when just modifying
55
+ # cmd/coordinator/*.go files.
56
+
57
+ COPY . /go/src/golang.org/x/build/
58
+
59
+ RUN go install -ldflags "-X 'main.Version=$version'" golang.org/x/build/cmd/coordinator
60
+
61
+
62
+ FROM debian:stretch AS build_drawterm
63
+
64
+ RUN apt-get update && apt-get install -y --no-install-recommends \
65
+ git-core ca-certificates make gcc libc6-dev libx11-dev
18
66
19
67
# drawterm connects to plan9 instances like:
20
68
# echo glenda123 | ./drawterm -a <addr> -c <addr> -u glenda -k user=glenda
@@ -25,5 +73,20 @@ RUN git clone https://github.com/0intro/conterm /tmp/conterm && \
25
73
CONF=unix make && mv /tmp/conterm/drawterm /usr/local/bin && \
26
74
rm -rf /tmp/conterm
27
75
28
- COPY coordinator /
76
+
77
+ FROM debian:stretch
78
+
79
+ # openssh client is for the gomote ssh proxy client.
80
+ # telnet is for the gomote ssh proxy to windows. (no ssh server there)
81
+ RUN apt-get update && apt-get install -y \
82
+ --no-install-recommends \
83
+ ca-certificates \
84
+ openssh-client \
85
+ telnet \
86
+ && rm -rf /var/lib/apt/lists/*
87
+
88
+
89
+ COPY --from=build /go/bin/coordinator /
90
+ COPY --from=build_drawterm /usr/local/bin/drawterm /usr/local/bin/
91
+
29
92
ENTRYPOINT ["/coordinator" ]
0 commit comments