golang.org/x/build@v0.0.0-20240506185731-218518f32b70/cmd/coordinator/Dockerfile (about)

     1  # Copyright 2017 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  RUN mkdir /gocache
     9  ENV GOCACHE /gocache
    10  
    11  COPY go.mod /go/src/golang.org/x/build/go.mod
    12  COPY go.sum /go/src/golang.org/x/build/go.sum
    13  
    14  WORKDIR /go/src/golang.org/x/build
    15  
    16  # Download module dependencies to improve speed of re-building the
    17  # Docker image during minor code changes.
    18  RUN go mod download
    19  
    20  # Makefile passes a string with --build-arg version
    21  # This becomes part of the cache key for all subsequent instructions,
    22  # so it must not be placed above the "go mod download" command above.
    23  ARG version=unknown
    24  
    25  # TODO: ideally we'd first copy all of x/build here EXCEPT
    26  # cmd/coordinator, then build x/build/..., and *then* COPY in the
    27  # cmd/coordinator files and then build the final binary. Currently we
    28  # do too much building of x/build/foo stuff when just modifying
    29  # cmd/coordinator/*.go files.
    30  
    31  COPY . /go/src/golang.org/x/build/
    32  
    33  RUN go install -ldflags "-X 'main.Version=$version'" golang.org/x/build/cmd/coordinator
    34  
    35  
    36  FROM debian:bookworm AS build_drawterm
    37  
    38  RUN apt-get update && apt-get install -y --no-install-recommends \
    39      git-core ca-certificates make gcc libc6-dev libx11-dev
    40  
    41  # drawterm connects to plan9 instances like:
    42  #    echo glenda123 | ./drawterm -a <addr> -c <addr> -u glenda -k user=glenda
    43  # Where <addr> is the IP address of the Plan 9 instance on GCE,
    44  # "glenda" is the username and "glenda123" is the password.
    45  RUN git clone https://github.com/0intro/conterm /tmp/conterm && \
    46      cd /tmp/conterm && \
    47      CONF=unix make && mv /tmp/conterm/drawterm /usr/local/bin && \
    48      rm -rf /tmp/conterm
    49  
    50  
    51  FROM debian:bookworm
    52  
    53  # openssh client is for the gomote ssh proxy client.
    54  # telnet is for the gomote ssh proxy to windows. (no ssh server there)
    55  RUN apt-get update && apt-get install -y \
    56  	--no-install-recommends \
    57  	ca-certificates \
    58  	openssh-client \
    59  	telnet \
    60  	&& rm -rf /var/lib/apt/lists/*
    61  
    62  
    63  COPY --from=build /go/src/golang.org/x/build/cmd/coordinator/internal/dashboard/dashboard.html /dashboard.html
    64  COPY --from=build /go/src/golang.org/x/build/cmd/coordinator/style.css /style.css
    65  COPY --from=build /go/bin/coordinator /
    66  COPY --from=build_drawterm /usr/local/bin/drawterm /usr/local/bin/
    67  
    68  ENTRYPOINT ["/coordinator"]