-
Notifications
You must be signed in to change notification settings - Fork 24
/
Dockerfile.base
60 lines (50 loc) · 1.87 KB
/
Dockerfile.base
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
FROM ubuntu:20.04 as builder
ENV LIBVIPS_VERSION 8.11.2
ENV GOLANG_VERSION 1.20.4
ARG TARGETARCH amd64
ARG TAG 'dev'
ARG COMMIT "master"
ARG DATE "now"
# Installs libvips + required libraries
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
ca-certificates \
automake build-essential curl \
gobject-introspection gtk-doc-tools libglib2.0-dev libjpeg-turbo8-dev libpng-dev \
libwebp-dev libtiff5-dev libgif-dev libexif-dev libxml2-dev libpoppler-glib-dev \
swig libmagickwand-dev libpango1.0-dev libmatio-dev libopenslide-dev libcfitsio-dev \
libgsf-1-dev fftw3-dev liborc-0.4-dev librsvg2-dev libimagequant-dev libaom-dev libbrotli-dev
RUN cd /tmp && \
curl -OL https://github.com/libvips/libvips/releases/download/v${LIBVIPS_VERSION}/vips-${LIBVIPS_VERSION}.tar.gz && \
tar zvxf vips-${LIBVIPS_VERSION}.tar.gz && \
cd /tmp/vips-${LIBVIPS_VERSION} && \
./configure --enable-debug=no --without-python $1 && \
make -j 4 && \
make install && \
ldconfig && \
apt-get autoremove -y && \
apt-get autoclean && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# gcc for cgo
RUN apt-get update && apt-get install -y \
gcc curl git libc6-dev make ca-certificates \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-$TARGETARCH.tar.gz
RUN curl -fsSL --insecure "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
&& tar -C /usr/local -xzf golang.tar.gz \
&& rm golang.tar.gz
ENV WORKDIR /workspace
ENV PATH /usr/local/go/bin:$PATH
WORKDIR $WORKDIR
COPY go.mod ./
COPY go.sum ./
RUN go mod download
COPY cmd/ $WORKDIR/cmd
COPY .godir ${WORKDIR}/.godir
COPY configuration/ ${WORKDIR}/configuration
COPY etc/ ${WORKDIR}/etc
COPY pkg/ ${WORKDIR}/pkg
COPY scripts/ ${WORKDIR}/scripts
COPY Makefile ${WORKDIR}/Makefile