Commit fb86dd0c authored by Philip ABBET's avatar Philip ABBET

Better use of the caching mechanism of Docker

parent 4b48bae5
Pipeline #6731 passed with stage
in 76 minutes and 10 seconds
......@@ -22,7 +22,7 @@
# #
###############################################################################
FROM beat.env.python:0.1.0__pre_build
FROM debian:8.4
MAINTAINER Andre Anjos <andre.anjos@idiap.ch>
# the destination directory that will contain the 'execute' environment
......@@ -33,7 +33,46 @@ ARG tarball
ADD $tarball $destdir
# Install the needed packages
RUN set -ex \
&& build_deps=' \
cmake \
dh-autoreconf \
gcc \
gfortran \
libatlas-dev \
libc-dev \
libfreetype6-dev \
libgomp1 \
libjpeg-dev \
liblapack-dev \
libpq-dev \
libreadline-dev \
make \
pkg-config \
unzip \
wget \
' \
&& apt-get update \
&& apt-get install -y $build_deps
# building of the content of the tarball
RUN make -C $destdir download \
&& make -C $destdir \
&& rm -rf $destdir/pkg $destdir/log
# remove the packages no longer needed, and and some runtime-only ones
RUN set -ex \
&& runtime_deps=' \
libatlas3-base \
libffi6 \
libfreetype6 \
libjpeg62-turbo \
libreadline6 \
' \
&& apt-get purge -y --auto-remove $build_deps \
&& apt-get install -y $runtime_deps \
&& rm -rf /var/lib/apt/lists/*
# change the PATH, so we can execute the scripts easily
ENV PATH $destdir/bin:$PATH
###############################################################################
# #
# Copyright (c) 2016 Idiap Research Institute, http://www.idiap.ch/ #
# Contact: beat.support@idiap.ch #
# #
# This file is part of the beat.backend.python module of the BEAT platform. #
# #
# Commercial License Usage #
# Licensees holding valid commercial BEAT licenses may use this file in #
# accordance with the terms contained in a written agreement between you #
# and Idiap. For further information contact tto@idiap.ch #
# #
# Alternatively, this file may be used under the terms of the GNU Affero #
# Public License version 3 as published by the Free Software and appearing #
# in the file LICENSE.AGPL included in the packaging of this file. #
# The BEAT platform is distributed in the hope that it will be useful, but #
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY #
# or FITNESS FOR A PARTICULAR PURPOSE. #
# #
# You should have received a copy of the GNU Affero Public License along #
# with the BEAT platform. If not, see http://www.gnu.org/licenses/. #
# #
###############################################################################
FROM beat.env.python:0.1.0__build
MAINTAINER Andre Anjos <andre.anjos@idiap.ch>
# the destination directory that will contain the 'execute' environment
ARG destdir=/usr/local/beat
# remove the packages no longer needed, and and some runtime-only ones
RUN set -ex \
&& build_deps=' \
cmake \
dh-autoreconf \
gcc \
gfortran \
libatlas-dev \
libc-dev \
libfreetype6-dev \
libgomp1 \
libjpeg-dev \
liblapack-dev \
libpq-dev \
libreadline-dev \
make \
pkg-config \
unzip \
wget \
' \
&& runtime_deps=' \
libatlas3-base \
libffi6 \
libfreetype6 \
libjpeg62-turbo \
libreadline6 \
' \
&& apt-get purge -y --auto-remove $build_deps \
&& apt-get install -y $runtime_deps \
&& rm -rf /var/lib/apt/lists/*
# change the PATH, so we can execute the scripts easily
ENV PATH $destdir/bin:$PATH
\ No newline at end of file
###############################################################################
# #
# Copyright (c) 2016 Idiap Research Institute, http://www.idiap.ch/ #
# Contact: beat.support@idiap.ch #
# #
# This file is part of the beat.backend.python module of the BEAT platform. #
# #
# Commercial License Usage #
# Licensees holding valid commercial BEAT licenses may use this file in #
# accordance with the terms contained in a written agreement between you #
# and Idiap. For further information contact tto@idiap.ch #
# #
# Alternatively, this file may be used under the terms of the GNU Affero #
# Public License version 3 as published by the Free Software and appearing #
# in the file LICENSE.AGPL included in the packaging of this file. #
# The BEAT platform is distributed in the hope that it will be useful, but #
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY #
# or FITNESS FOR A PARTICULAR PURPOSE. #
# #
# You should have received a copy of the GNU Affero Public License along #
# with the BEAT platform. If not, see http://www.gnu.org/licenses/. #
# #
###############################################################################
FROM debian:8.4
MAINTAINER Andre Anjos <andre.anjos@idiap.ch>
RUN set -ex \
&& build_deps=' \
cmake \
dh-autoreconf \
gcc \
gfortran \
libatlas-dev \
libc-dev \
libfreetype6-dev \
libgomp1 \
libjpeg-dev \
liblapack-dev \
libpq-dev \
libreadline-dev \
make \
pkg-config \
unzip \
wget \
' \
&& apt-get update \
&& apt-get install -y $build_deps
......@@ -20,6 +20,4 @@ if [ $# == 2 ]; then
fi
# Build the image (in three steps)
docker build --rm=true -t "${IMAGE_NAME}:${IMAGE_TAG}__pre_build" -f ./Dockerfile_pre_build .
./scripts/build.sh "${PROJECT_REPOSITORY}" $PROJECT_BRANCH $IMAGE_NAME "${IMAGE_TAG}__build"
docker build --rm=true -t "${REGISTRY}/${IMAGE_NAME}:${IMAGE_TAG}" -f ./Dockerfile_post_build .
./scripts/build.sh "${PROJECT_REPOSITORY}" $PROJECT_BRANCH $IMAGE_NAME $IMAGE_TAG
Subproject commit 1b54797b95ee83e679f1715d6d1619f573c91d2f
Subproject commit ea1fb21701b79f2b05c1d07916750a1781a12ea4
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment