Skip to content
Snippets Groups Projects
Commit b5b7acad authored by egon w. stemle's avatar egon w. stemle :robot:
Browse files

Prevent ARG/ENV invaliding cache

See, for example, https://github.com/moby/moby/issues/18017; ARG may
invalidate following `RUN` statements because it implicitly alters the
build context.

Also, use
* apt.local.conf
* ubuntu-16.04.sources.list

Fix #64
parent 016e9bab
No related branches found
No related tags found
No related merge requests found
......@@ -3,38 +3,31 @@
# Based on Ubuntu
##############################################################################
FROM ubuntu:16.04
ARG UBUNTU_VERSION=16.04
FROM ubuntu:$UBUNTU_VERSION
ARG UBUNTU_VERSION
ARG LABEL_VERSION
ARG LABEL_BUILD_DATE
ARG LABEL_VCS_URL="https://gitlab.inf.unibz.it/commul/docker/clarin-dspace"
ARG TOMCAT_VERSION="8.0.53"
ARG TOMCAT_SHA512="cd8a4e48a629a2f2bb4ce6b101ebcce41da52b506064396ec1b2915c0b0d8d82123091242f2929a649bcd8b65ecf6cd1ab9c7d90ac0e261821097ab6fbe22df9 *apache-tomcat-8.0.53.tar.gz"
# https://archive.apache.org/dist/tomcat/tomcat-8/v8.0.53/bin/apache-tomcat-8.0.53.tar.gz.sha512
LABEL maintainer="Alexander König <Alexander.Koenig@eurac.edu>" \
maintainer="Egon W. Stemle <egon.stemle@eurac.edu>" \
org.label-schema.vcs-url=$LABEL_VCS_URL
maintainer="Egon W. Stemle <egon.stemle@eurac.edu>"
#
ENV DEBIAN_FRONTEND=noninteractive
# Set "APT::Get::{Assume-Yes, Fix-Broken} to true"
RUN echo 'APT { GET { Assume-Yes "true"; }; };' \
>> /etc/apt/apt.conf && \
echo 'APT { GET { Fix-Broken "true"; }; };' \
>> /etc/apt/apt.conf
ENV TOMCAT_VERSION="8.0.53"
ENV TOMCAT_SHA512="cd8a4e48a629a2f2bb4ce6b101ebcce41da52b506064396ec1b2915c0b0d8d82123091242f2929a649bcd8b65ecf6cd1ab9c7d90ac0e261821097ab6fbe22df9 *apache-tomcat-8.0.53.tar.gz"
# https://archive.apache.org/dist/tomcat/tomcat-8/v8.0.53/bin/apache-tomcat-8.0.53.tar.gz.sha512
ENV TERM linux
# APT(-GET) tweaks
# Set some sane defaults for apt inside docker
ENV DEBIAN_FRONTEND=noninteractive
COPY apt.local.conf /etc/apt/apt.conf.d/99local.conf
# use fast(er) local mirrors
# http://layer0.authentise.com/docker-4-useful-tips-you-may-not-know-about.html
RUN echo "deb mirror://mirrors.ubuntu.com/mirrors.txt xenial main restricted universe multiverse" > /etc/apt/sources.list && \
echo "deb mirror://mirrors.ubuntu.com/mirrors.txt xenial-updates main restricted universe multiverse" >> /etc/apt/sources.list && \
echo "deb mirror://mirrors.ubuntu.com/mirrors.txt xenial-security main restricted universe multiverse" >> /etc/apt/sources.list && \
apt-get update && \
apt-get upgrade --show-progress
COPY ubuntu-$UBUNTU_VERSION.sources.list /etc/apt/sources.list
RUN apt-get update && \
apt-get upgrade
# install cpanm and dependencies
# install jdk, ant, psql, mvn, make, libxml, xsltproc, zip, wget
RUN apt-get install \
RUN apt-get update && apt-get install \
unzip curl wget git \
make gcc \
cpanminus \
......@@ -44,14 +37,13 @@ RUN apt-get install \
RUN cpanm -n File::Spec::Functions && \
cpanm Term::ReadLine
# install convenience apps for debug purposes (vim and jsbeautifier)
RUN apt-get install vim less python-pip
RUN apt-get update && apt-get install vim less python-pip
RUN pip install jsbeautifier
COPY commul-customization/__init__.py /usr/local/lib/python2.7/dist-packages/jsbeautifier/
# set up a proper locale
RUN apt-get install locales
RUN apt-get update && apt-get install locales
RUN locale-gen en_US.UTF-8
COPY commul-customization/default_locale /etc/default/locale
RUN chmod 0755 /etc/default/locale
......@@ -117,7 +109,7 @@ COPY commul-customization/variable.makefile /opt/repository/workspace/config/var
# COPY commul-customization/dspace.cfg /opt/repository/sources/dspace/dspace/config/dspace.cfg
# install python modules: magic dateutil, lxml
RUN apt-get install python-magic python-dateutil python-lxml
RUN apt-get update && apt-get install python-magic python-dateutil python-lxml
# copy over configs and startup scripts
COPY commul-customization/start_stack.sh /opt/repository/workspace/scripts/
......@@ -147,8 +139,11 @@ RUN cp /opt/repository/workspace/config/etc/init.d/handle-server /etc/init.d/
RUN chmod +x /etc/init.d/handle-server
RUN perl -pi -e 's#DSPACE_INSTALLATION_DIRECTORY=#DSPACE_INSTALLATION_DIRECTORY=/opt/lindat-dspace/installation#' /etc/default/handle-server
ARG LABEL_VERSION
ARG LABEL_BUILD_DATE
LABEL org.label-schema.version=$LABEL_VERSION \
org.label-schema.build-date=$LABEL_BUILD_DATE
org.label-schema.build-date=$LABEL_BUILD_DATE \
org.label-schema.vcs-url=$LABEL_VCS_URL
# copy entrypoint script and start
COPY commul-customization/entrypoint.sh /usr/bin/entrypoint.sh
......
......@@ -3,17 +3,29 @@
# Based on Ubuntu
############################################################
FROM ubuntu
LABEL maintainer="Alexander König <Alexander.Koenig@eurac.edu>"
ARG UBUNTU_VERSION=16.04
FROM ubuntu:$UBUNTU_VERSION
ARG UBUNTU_VERSION
ARG LABEL_VCS_URL="https://gitlab.inf.unibz.it/commul/docker/clarin-dspace"
LABEL maintainer="Alexander König <Alexander.Koenig@eurac.edu>" \
maintainer="Egon W. Stemle <egon.stemle@eurac.edu>"
ENV TERM linux
# APT(-GET) tweaks
# Set some sane defaults for apt inside docker
ENV DEBIAN_FRONTEND=noninteractive
COPY apt.local.conf /etc/apt/apt.conf.d/99local.conf
# use fast(er) local mirrors
COPY ubuntu-$UBUNTU_VERSION.sources.list /etc/apt/sources.list
RUN apt-get update && \
apt-get upgrade
RUN apt-get update &&\
apt-get -y upgrade &&\
apt-get -y install openjdk-8-jdk unzip wget make cpanminus gcc
apt-get install openjdk-8-jdk unzip wget make cpanminus gcc
# convenience packages
RUN apt-get -y install less vim
RUN apt-get update && apt-get install less vim
RUN cpanm Term::ReadLine
RUN cpanm File::Spec::Functions
......@@ -29,5 +41,12 @@ RUN cat /tmp/hdl-setup.tmp | bin/hdl-setup-server /hs/svr_1/
RUN perl -pi -e 's/YOUR_PREFIX/20.500.12084/' /hs/svr_1/config.dct
RUN perl -pi -e 's/case_sensitive" = "no/case_sensitive" = "yes/' /hs/svr_1/config.dct
RUN perl -i -plne 'print " \"storage_type\" = \"CUSTOM\"\n\ \"storage_class\" = \"org.dspace.handle.HandlePlugin\"" if(/max_session/);' /hs/svr_1/config.dct
ARG LABEL_VERSION
ARG LABEL_BUILD_DATE
LABEL org.label-schema.version=$LABEL_VERSION \
org.label-schema.build-date=$LABEL_BUILD_DATE \
org.label-schema.vcs-url=$LABEL_VCS_URL
# ENTRYPOINT ["/bin/bash"]
CMD tail -f /hs/svr_1/config.dct
......@@ -3,37 +3,43 @@
# Based on Ubuntu
##############################################################################
FROM ubuntu:16.04
ARG UBUNTU_VERSION=16.04
FROM ubuntu:$UBUNTU_VERSION
ARG UBUNTU_VERSION
ARG LABEL_VERSION
ARG LABEL_BUILD_DATE
ARG LABEL_VCS_URL="https://gitlab.inf.unibz.it/commul/docker/clarin-dspace"
LABEL maintainer="Alexander König <Alexander.Koenig@eurac.edu>" \
maintainer="Egon W. Stemle <egon.stemle@eurac.edu>" \
org.label-schema.vcs-url=$LABEL_VCS_URL
maintainer="Egon W. Stemle <egon.stemle@eurac.edu>"
ENV TERM linux
# APT(-GET) tweaks
# Set some sane defaults for apt inside docker
ENV DEBIAN_FRONTEND=noninteractive
COPY apt.local.conf /etc/apt/apt.conf.d/99local.conf
# use fast(er) local mirrors
COPY ubuntu-$UBUNTU_VERSION.sources.list /etc/apt/sources.list
RUN apt-get update && \
apt-get upgrade
# install cpanm and dependencies
RUN apt-get update \
&& apt-get -y upgrade \
&& apt-get -y install make gcc wget cpanminus
&& apt-get install make gcc wget cpanminus
RUN cpanm -n File::Spec::Functions
RUN cpanm Term::ReadLine
# install jdk, ant, psql, mvn, make, libxml, xsltproc, zip, wget
RUN apt-get update \
&& apt-get -y install ant curl libxml2-utils maven openjdk-8-jdk unzip xsltproc yui-compressor
&& apt-get install ant curl libxml2-utils maven openjdk-8-jdk unzip xsltproc yui-compressor
# install convenience apps for debug purposes (vim and jsbeautifier)
RUN apt-get -y install vim less python-pip
RUN apt-get update && apt-get install vim less python-pip
RUN pip install --upgrade pip
RUN pip install jsbeautifier
COPY commul-customization/__init__.py /usr/local/lib/python2.7/dist-packages/jsbeautifier/
# set up a proper locale
RUN apt-get -y install locales
RUN apt-get update && apt-get install locales
RUN locale-gen en_US.UTF-8
COPY commul-customization/default_locale /etc/default/locale
RUN chmod 0755 /etc/default/locale
......@@ -43,7 +49,7 @@ ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8
# build nginx
RUN apt-get install -y zlib1g zlib1g-dev libpcre3 libpcre3-dev curl
RUN apt-get update && apt-get install zlib1g zlib1g-dev libpcre3 libpcre3-dev curl
RUN cpanm File::Spec::Functions
RUN cpanm Term::ReadLine
COPY commul-customization/nginx_build.sh /tmp/nginx_build.sh
......@@ -67,13 +73,13 @@ RUN chown -R www-data:www-data /opt/nginx/html/
#COPY commul-customization/eurac.png /opt/nginx/html/img/
# install php
RUN apt-get update && apt-get install -y php-fpm php-xml
RUN apt-get update && apt-get install php-fpm php-xml
# copy over aa-statistics script
RUN mkdir /opt/nginx/html/php
COPY commul-customization/aa-statistics.php /opt/nginx/html/php/
# get aai project
RUN apt-get install -y git
RUN apt-get update && apt-get install git
RUN git clone https://github.com/ufal/lindat-aai-discovery.git /opt/repository/sources/lindat-aai-discovery
# install shibboleth
......@@ -87,7 +93,7 @@ RUN chmod a+x /etc/init.d/shibd
# create the test secure folder and set up perl fastcgi
RUN mkdir /opt/nginx/html/secure
RUN apt-get update && apt-get install -y fcgiwrap
RUN apt-get update && apt-get install fcgiwrap
RUN cpanm CGI URI XML::Twig LWP::Protocol::https
COPY commul-customization/shib_test.pl /opt/nginx/html/secure/
COPY commul-customization/shib_fastcgi_params /opt/nginx/conf/
......@@ -96,7 +102,7 @@ RUN chown -R www-data:www-data /opt/nginx/html/secure
RUN chmod a+x /opt/nginx/html/secure/shib_test.pl
# install supervisor
RUN apt-get install -y python-setuptools
RUN apt-get update && apt-get install python-setuptools
RUN easy_install supervisor
COPY commul-customization/supervisord.conf /etc/
RUN mkdir -p /var/log/supervisor
......@@ -135,7 +141,10 @@ RUN yui-compressor -o aai.min.js aai.js
# add IdP metadata from CLARIN server
ADD https://infra.clarin.eu/aai/prod_md_about_spf_idps.xml /opt/shibboleth-sp-fastcgi/var/cache/shibboleth/
ARG LABEL_VERSION
ARG LABEL_BUILD_DATE
LABEL org.label-schema.version=$LABEL_VERSION \
org.label-schema.build-date=$LABEL_BUILD_DATE
org.label-schema.build-date=$LABEL_BUILD_DATE \
org.label-schema.vcs-url=$LABEL_VCS_URL
ENTRYPOINT ["/usr/local/bin/supervisord", "-c", "/etc/supervisord.conf"]
......@@ -3,19 +3,26 @@
# Based on Postgres
##############################################################################
FROM postgres:9.6
ARG POSTGRES_VERSION=9.6
FROM postgres:$POSTGRES_VERSION
ARG POSTGRES_VERSION
ARG LABEL_VERSION
ARG LABEL_BUILD_DATE
ARG LABEL_VCS_URL="https://gitlab.inf.unibz.it/commul/docker/clarin-dspace"
LABEL maintainer="Alexander König <Alexander.Koenig@eurac.edu>" \
maintainer="Egon W. Stemle <egon.stemle@eurac.edu>" \
org.label-schema.vcs-url=$LABEL_VCS_URL
maintainer="Egon W. Stemle <egon.stemle@eurac.edu>"
# install git
RUN apt-get update && apt-get -y install git
ENV TERM linux
# APT(-GET) tweaks
# Set some sane defaults for apt inside docker
ENV DEBIAN_FRONTEND=noninteractive
COPY apt.local.conf /etc/apt/apt.conf.d/99local.conf
#
#
RUN apt-get update && \
apt-get upgrade
# Install git
RUN apt-get update && apt-get install git
# copy int db script
RUN mkdir -p /docker-entrypoint-initdb.d
......@@ -31,5 +38,8 @@ RUN mkdir /tmp/sql/
COPY adapt_utilities_sql.sh /tmp/sql/
RUN /tmp/sql/adapt_utilities_sql.sh
ARG LABEL_VERSION
ARG LABEL_BUILD_DATE
LABEL org.label-schema.version=$LABEL_VERSION \
org.label-schema.build-date=$LABEL_BUILD_DATE
org.label-schema.build-date=$LABEL_BUILD_DATE \
org.label-schema.vcs-url=$LABEL_VCS_URL
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment