blob: 6bbb56a334cb034730e0a519af3d15968a4fd25c [file] [log] [blame]
# Copyright 2017 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
FROM golang:1.17 AS build
LABEL maintainer=""
RUN mkdir /gocache
ENV GOCACHE /gocache
COPY go.mod /go/src/
COPY go.sum /go/src/
WORKDIR /go/src/
# Download module dependencies to improve speed of re-building the
# Docker image during minor code changes.
RUN go mod download
COPY . /go/src/
RUN go install
FROM debian:stretch
LABEL maintainer=""
# netbase and ca-certificates are needed for dialing TLS.
# The rest are useful for debugging if somebody needs to exec into the container.
RUN apt-get update && apt-get install -y \
--no-install-recommends \
netbase \
ca-certificates \
curl \
strace \
procps \
lsof \
psmisc \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /go/bin/gopherbot /
ENTRYPOINT ["/gopherbot"]