golang.org/x/build@v0.0.0-20240506185731-218518f32b70/cmd/gomoteserver/Dockerfile (about) 1 # Copyright 2023 The Go Authors. All rights reserved. 2 # Use of this source code is governed by a BSD-style 3 # license that can be found in the LICENSE file. 4 5 FROM golang:1.21-bookworm AS build 6 LABEL maintainer="golang-dev@googlegroups.com" 7 8 COPY go.mod /go/src/golang.org/x/build/go.mod 9 COPY go.sum /go/src/golang.org/x/build/go.sum 10 11 WORKDIR /go/src/golang.org/x/build 12 13 # Download module dependencies to improve speed of re-building the 14 # Docker image during minor code changes. 15 RUN go mod download 16 17 # Makefile passes a string with --build-arg version 18 # This becomes part of the cache key for all subsequent instructions, 19 # so it must not be placed above the "go mod download" command above. 20 ARG version=unknown 21 22 COPY . /go/src/golang.org/x/build/ 23 24 RUN go install -ldflags "-X 'main.Version=$version'" golang.org/x/build/cmd/gomoteserver 25 26 FROM debian:bookworm AS build_drawterm 27 28 RUN apt-get update && apt-get install -y --no-install-recommends \ 29 git-core ca-certificates make gcc libc6-dev libx11-dev 30 31 # drawterm connects to plan9 instances like: 32 # echo glenda123 | ./drawterm -a <addr> -c <addr> -u glenda -k user=glenda 33 # Where <addr> is the IP address of the Plan 9 instance on GCE, 34 # "glenda" is the username and "glenda123" is the password. 35 RUN git clone https://github.com/0intro/conterm /tmp/conterm && \ 36 cd /tmp/conterm && \ 37 CONF=unix make && mv /tmp/conterm/drawterm /usr/local/bin && \ 38 rm -rf /tmp/conterm 39 40 FROM debian:bookworm 41 42 # openssh client is for the gomote ssh proxy client. 43 # telnet is for the gomote ssh proxy to windows. (no ssh server there) 44 RUN apt-get update && apt-get install -y \ 45 --no-install-recommends \ 46 ca-certificates \ 47 openssh-client \ 48 telnet \ 49 && rm -rf /var/lib/apt/lists/* 50 51 COPY --from=build /go/bin/gomoteserver / 52 COPY --from=build_drawterm /usr/local/bin/drawterm /usr/local/bin/ 53 54 ENTRYPOINT ["/gomoteserver"]