docker: use public golang:1.18 image as builder

The only practical difference was that perkeep's builder was installing
libsqlite3-dev, which is no longer needed since c986ee3.  This
simplifies our Dockerfile and bumps us to a more recent debian and
go version.
This commit is contained in:
Will Norris 2022-05-03 11:21:58 -07:00 committed by Brad Fitzpatrick
parent ef8cb042ff
commit cd0b392d11
1 changed files with 1 additions and 24 deletions

View File

@ -7,35 +7,12 @@
# misc/docker/heiftojpeg's Dockerfile entirely. Not decided best way.
# TODO: likewise, djpeg binary? maybe. https://perkeep.org/issue/1142
FROM buildpack-deps:stretch-scm AS pkbuild
FROM golang:1.18 AS pkbuild
MAINTAINER Perkeep Authors <perkeep@googlegroups.com>
ENV DEBIAN_FRONTEND noninteractive
# gcc for cgo, sqlite
RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
gcc \
libc6-dev \
make \
pkg-config \
libsqlite3-dev
ENV GOLANG_VERSION 1.16.6
WORKDIR /usr/local
RUN wget -O go.tgz https://dl.google.com/go/go${GOLANG_VERSION}.linux-amd64.tar.gz
RUN echo "be333ef18b3016e9d7cb7b1ff1fdb0cac800ca0be4cf2290fe613b3d069dfe0d go.tgz" | sha256sum -c -
RUN tar -zxvf go.tgz
ENV GOROOT /usr/local/go
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
WORKDIR $GOPATH
# Add each directory separately, so our context doesn't include the
# Dockerfile itself, to permit quicker iteration with docker's
# caching.