Dockerfile 1.77 KB
Newer Older
Benjamin Rokseth's avatar
Benjamin Rokseth committed
1 2 3
FROM golang:1.10 as builder

WORKDIR /go/src/app
4
ADD minotaur.go .
Benjamin Rokseth's avatar
Benjamin Rokseth committed
5 6 7

RUN go get -d -v ./...
RUN go install -v ./...
8
RUN CGO_ENABLED=0 GOOS=linux go build -o minotaur
Benjamin Rokseth's avatar
Benjamin Rokseth committed
9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
FROM alpine:3.8
ARG LIBVIPS_VERSION_MAJOR_MINOR=8.6
ARG LIBVIPS_VERSION_PATCH=3
ARG MOZJPEG_VERSION="v3.2"
RUN apk update && \
    apk add zlib libxml2 libxslt glib libexif lcms2 fftw ca-certificates \
    giflib libpng libwebp orc tiff poppler-glib librsvg && \
#
    apk add --no-cache --virtual .build-dependencies autoconf automake build-base \
    git libtool nasm zlib-dev libxml2-dev libxslt-dev glib-dev \
    libexif-dev lcms2-dev fftw-dev giflib-dev libpng-dev libwebp-dev orc-dev tiff-dev \
    poppler-dev librsvg-dev wget && \
# Install mozjpeg
    cd /tmp && \
    git clone git://github.com/mozilla/mozjpeg.git && \
    cd /tmp/mozjpeg && \
    git checkout ${MOZJPEG_VERSION} && \
    autoreconf -fiv && ./configure --prefix=/usr && make install && \
# Install libvips
29
    wget -O- https://github.com/libvips/libvips/releases/download/v${LIBVIPS_VERSION_MAJOR_MINOR}.${LIBVIPS_VERSION_PATCH}/vips-${LIBVIPS_VERSION_MAJOR_MINOR}.${LIBVIPS_VERSION_PATCH}.tar.gz | tar xzC /tmp && \
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
    cd /tmp/vips-${LIBVIPS_VERSION_MAJOR_MINOR}.${LIBVIPS_VERSION_PATCH} && \
    ./configure --prefix=/usr \
                --without-python \
                --without-gsf \
                --enable-debug=no \
                --disable-dependency-tracking \
                --disable-static \
                --enable-silent-rules && \
    make -s install-strip && \
    cd $OLDPWD && \
# Cleanup
    rm -rf /tmp/vips-${LIBVIPS_VERSION_MAJOR_MINOR}.${LIBVIPS_VERSION_PATCH} && \
    rm -rf /tmp/mozjpeg && \
    apk del --purge .build-dependencies && \
    rm -rf /var/cache/apk/*
Benjamin Rokseth's avatar
Benjamin Rokseth committed
45 46 47

COPY --from=builder /go/src/app/minotaur /minotaur
CMD /minotaur