blob: ba93313a1867760f8b8a652ba75d3b44a3896d33 [file] [log] [blame]
# Copyright 2014 The Perkeep Authors.
# Generic purpose Perkeep image, that builds the server (perkeepd)
# and the command-line clients (pk, pk-put, pk-get, and pk-mount).
# TODO: add the HEIC-supporting imagemagick to this Dockerfile too, in
# some way that's minimally gross and not duplicating
# misc/docker/heiftojpeg's Dockerfile entirely. Not decided best way.
# TODO: likewise, djpeg binary? maybe.
FROM buildpack-deps:stretch-scm AS pkbuild
MAINTAINER Perkeep Authors <>
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 \
WORKDIR /usr/local
RUN wget -O go.tgz
RUN echo "4b677d698c65370afa33757b6954ade60347aaca310ea92a63ed717d7cb0c2ff go.tgz" | sha256sum -c -
RUN tar -zxvf go.tgz
ENV GOROOT /usr/local/go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
# Add each directory separately, so our context doesn't include the
# Dockerfile itself, to permit quicker iteration with docker's
# caching.
ADD .git /go/src/
add app /go/src/
ADD clients /go/src/
ADD cmd /go/src/
ADD config /go/src/
ADD dev /go/src/
ADD doc /go/src/
ADD internal /go/src/
ADD pkg /go/src/
ADD server /go/src/
ADD vendor /go/src/
ADD website /go/src/
ADD make.go /go/src/
ADD VERSION /go/src/
WORKDIR /go/src/
RUN go run make.go --sqlite=true -v
FROM debian:stretch
RUN apt-get update && apt-get install -y --no-install-recommends \
libsqlite3-dev && rm -rf /var/lib/apt/lists/*
RUN mkdir -p /home/keepy/bin
ENV HOME /home/keepy
ENV PATH /home/keepy/bin:$PATH
COPY --from=pkbuild /go/bin/pk* /home/keepy/bin/
COPY --from=pkbuild /go/bin/perkeepd /home/keepy/bin/
EXPOSE 80 443 3179 8080
WORKDIR /home/keepy
CMD /bin/bash