From ed66c4b705b85976b9427fc1d38af8d43e80d4ef Mon Sep 17 00:00:00 2001 From: Disassembler Date: Mon, 8 Jan 2018 21:04:35 +0100 Subject: [PATCH] Reorganize Dockerfiles --- ckan-datapusher/Dockerfile | 6 ++++-- ckan/Dockerfile | 6 ++++-- crisiscleanup/Dockerfile | 24 +++++++++++++++++------- cts/Dockerfile | 6 ++++-- gnuhealth/Dockerfile | 6 ++++-- kanboard/Dockerfile | 4 ++-- openmapkit/Dockerfile | 25 +++++++++++++++++++------ seeddms/Dockerfile | 6 ++++-- solr/Dockerfile | 7 ++++--- 9 files changed, 62 insertions(+), 28 deletions(-) diff --git a/ckan-datapusher/Dockerfile b/ckan-datapusher/Dockerfile index 724dd6b..5bed824 100644 --- a/ckan-datapusher/Dockerfile +++ b/ckan-datapusher/Dockerfile @@ -11,9 +11,11 @@ RUN \ RUN \ # Install runtime dependencies - apk --no-cache add libffi libressl libxml2 libxslt uwsgi-python \ + apk --no-cache add libffi libressl uwsgi-python + +RUN \ # Install build dependencies - && apk --no-cache add --virtual .deps build-base git libffi-dev libressl-dev libxml2-dev libxslt-dev py2-pip python2-dev \ + apk --no-cache add --virtual .deps build-base git libffi-dev libressl-dev libxml2-dev libxslt-dev py2-pip python2-dev \ # Install CKAN DataPusher && mkdir -p /srv/ckan-datapusher \ && cd /srv/ckan-datapusher \ diff --git a/ckan/Dockerfile b/ckan/Dockerfile index 3867175..ade3a61 100644 --- a/ckan/Dockerfile +++ b/ckan/Dockerfile @@ -11,9 +11,11 @@ RUN \ RUN \ # Install runtime dependencies - apk --no-cache add libjpeg-turbo libmagic libpq py2-pip zlib \ + apk --no-cache add libjpeg-turbo libmagic libpq py2-pip zlib + +RUN \ # Install build dependencies - && apk --no-cache add --virtual .deps git build-base libjpeg-turbo-dev libxml2-dev libxslt-dev postgresql-dev python2-dev zlib-dev \ + apk --no-cache add --virtual .deps git build-base libjpeg-turbo-dev libxml2-dev libxslt-dev postgresql-dev python2-dev zlib-dev \ # Add edge/testing repository for postgis (geos) support && echo 'http://dl-cdn.alpinelinux.org/alpine/edge/testing' >>/etc/apk/repositories \ && apk --no-cache add geos \ diff --git a/crisiscleanup/Dockerfile b/crisiscleanup/Dockerfile index 8310a81..74bd7af 100644 --- a/crisiscleanup/Dockerfile +++ b/crisiscleanup/Dockerfile @@ -1,9 +1,19 @@ FROM alpine:3.7 MAINTAINER Disassembler +RUN \ + # Install NodeJS runtime + apk --no-cache add nodejs paxctl \ + # Fix grsec attributes to loosen memory protection restrictions + && paxctl -cm /usr/bin/node \ + # Cleanup + && apk del paxctl + RUN \ # Install Ruby runtime dependencies - apk --no-cache add gdbm libressl readline zlib \ + apk --no-cache add gdbm libressl readline zlib + +RUN \ # Install Ruby build dependencies && apk --no-cache add --virtual .deps build-base autoconf gdbm-dev libressl-dev linux-headers readline-dev zlib-dev \ # Download and unpack Ruby @@ -27,7 +37,7 @@ RUN \ # Cleanup && cd /tmp \ && rm -r /usr/src/ruby \ - && apk --no-cache del .deps \ + && apk del .deps \ && rm -rf /root \ && mkdir /root @@ -35,11 +45,11 @@ ENV RAILS_ENV production RUN \ # Install runtime dependencies - apk --no-cache add libpq libxml2 libxslt nodejs tzdata \ + apk --no-cache add libpq libxml2 libxslt tzdata + +RUN \ # Install build dependencies - && apk --no-cache add --virtual .deps build-base git libxml2-dev libxslt-dev linux-headers paxctl postgresql-dev yarn zlib-dev \ - # Fix grsec attributes to loosen memory protection restrictions - && paxctl -cm /usr/bin/node \ + apk --no-cache add --virtual .deps build-base git libxml2-dev libxslt-dev linux-headers postgresql-dev yarn zlib-dev \ # Clone CrisisCleanup && git clone --depth 1 https://github.com/CrisisCleanup/crisiscleanup /srv/crisiscleanup \ # Hackfix ruby dependency versions @@ -60,7 +70,7 @@ RUN \ && adduser -S -u 8005 -h /srv/crisiscleanup -s /bin/false -g crisiscleanup -G crisiscleanup crisiscleanup \ && chown -R crisiscleanup:crisiscleanup /srv/crisiscleanup \ # Cleanup - && apk --no-cache del .deps \ + && apk del .deps \ && rm -rf /srv/crisiscleanup/.git* \ && rm -rf /usr/local/share/.cache \ && rm -rf /root \ diff --git a/cts/Dockerfile b/cts/Dockerfile index 7c8e0d3..0a36740 100644 --- a/cts/Dockerfile +++ b/cts/Dockerfile @@ -7,9 +7,11 @@ RUN \ RUN \ # Install runtime dependencies - apk --no-cache add libpq zlib \ + apk --no-cache add libpq zlib + +RUN \ # Install build dependencies - && apk --no-cache add --virtual .deps git build-base postgresql-dev python2-dev py2-pip zlib-dev \ + apk --no-cache add --virtual .deps git build-base postgresql-dev python2-dev py2-pip zlib-dev \ # Add edge/testing repository for postgis (geos) support && echo 'http://dl-cdn.alpinelinux.org/alpine/edge/testing' >>/etc/apk/repositories \ && apk --no-cache add geos \ diff --git a/gnuhealth/Dockerfile b/gnuhealth/Dockerfile index 60bb2a1..c97cddd 100644 --- a/gnuhealth/Dockerfile +++ b/gnuhealth/Dockerfile @@ -11,9 +11,11 @@ RUN \ RUN \ # Install runtime dependencies - apk --no-cache add bash coreutils libffi libjpeg-turbo libpq nodejs \ + apk --no-cache add bash coreutils libffi libjpeg-turbo libpq nodejs + +RUN \ # Install build dependencies - && apk --no-cache add --virtual .deps build-base git libffi-dev libjpeg-turbo-dev libxml2-dev libxslt-dev ncurses patch postgresql-dev python3-dev sudo \ + apk --no-cache add --virtual .deps build-base git libffi-dev libjpeg-turbo-dev libxml2-dev libxslt-dev ncurses patch postgresql-dev python3-dev sudo \ # Download GNU Health && wget http://ftp.gnu.org/gnu/health/gnuhealth-3.2.8.tar.gz -O /tmp/gnuhealth.tgz \ && tar xzf /tmp/gnuhealth.tgz -C /srv \ diff --git a/kanboard/Dockerfile b/kanboard/Dockerfile index 66176ca..624dd5f 100644 --- a/kanboard/Dockerfile +++ b/kanboard/Dockerfile @@ -5,8 +5,6 @@ RUN \ # Install PHP runtime apk --no-cache add nginx php7-fpm s6 -COPY docker/ / - RUN \ # Install runtime dependencies apk --no-cache add php7 php7-ctype php7-dom php7-gd php7-iconv php7-json php7-mbstring php7-mcrypt php7-opcache php7-openssl php7-pdo_pgsql php7-posix php7-session php7-simplexml php7-sockets php7-xml php7-zip php7-zlib @@ -40,6 +38,8 @@ RUN \ && rm -rf /root \ && mkdir /root +COPY docker/ / + VOLUME ["/srv/kanboard/app/data"] EXPOSE 8009 diff --git a/openmapkit/Dockerfile b/openmapkit/Dockerfile index 8c7ef45..9c53f59 100644 --- a/openmapkit/Dockerfile +++ b/openmapkit/Dockerfile @@ -1,17 +1,30 @@ FROM alpine:3.7 MAINTAINER Disassembler +RUN \ + # Install Java 1.8 JRE + apk --no-cache add openjdk8-jre-base paxctl \ + # Fix grsec attributes to loosen memory protection restrictions + && paxctl -cm /usr/lib/jvm/java-1.8-openjdk/jre/bin/java \ + && paxctl -cm /usr/lib/jvm/java-1.8-openjdk/bin/java \ + # Cleanup + && apk del paxctl + +RUN \ + # Install NodeJS runtime + apk --no-cache add nodejs paxctl \ + # Fix grsec attributes to loosen memory protection restrictions + && paxctl -cm /usr/bin/node \ + # Cleanup + && apk del paxctl + RUN \ # Install Python2 runtime apk --no-cache add python2 RUN \ - # Install runtime dependencies - apk --no-cache add nodejs openjdk8-jre-base \ # Install build dependencies - && apk --no-cache add --virtual .deps git build-base paxctl py2-pip yarn \ - # Fix grsec attributes to loosen memory protection restrictions - && paxctl -cm /usr/bin/node \ + apk --no-cache add --virtual .deps git build-base py2-pip yarn \ # Clone OpenMapKit && git clone --depth 1 https://github.com/AmericanRedCross/OpenMapKitServer /srv/openmapkit \ && cd /srv/openmapkit \ @@ -25,7 +38,7 @@ RUN \ && adduser -S -u 8007 -h /srv/openmapkit -s /bin/false -g omk -G omk omk \ && chown -R omk:omk /srv/openmapkit \ # Cleanup - && apk --no-cache del .deps \ + && apk del .deps \ && rm -rf /srv/openmapkit/.git* /srv/openmapkit/api/odk/pyxform/.git* \ && rm -rf /usr/local/share/.cache \ && rm -rf /root \ diff --git a/seeddms/Dockerfile b/seeddms/Dockerfile index 53a69ff..539c4c2 100644 --- a/seeddms/Dockerfile +++ b/seeddms/Dockerfile @@ -7,9 +7,11 @@ RUN \ RUN \ # Install runtime dependencies - apk --no-cache add ghostscript imagemagick libreoffice-calc libreoffice-impress libreoffice-writer php7-gd php7-iconv php7-json php7-mbstring php7-pear php7-pdo_pgsql php7-simplexml php7-xml poppler-utils \ + apk --no-cache add ghostscript imagemagick libreoffice-calc libreoffice-impress libreoffice-writer php7-gd php7-iconv php7-json php7-mbstring php7-pear php7-pdo_pgsql php7-simplexml php7-xml poppler-utils + +RUN \ # Install unoconv - && wget https://raw.githubusercontent.com/dagwieers/unoconv/master/unoconv -O /usr/local/bin/unoconv \ + wget https://raw.githubusercontent.com/dagwieers/unoconv/master/unoconv -O /usr/local/bin/unoconv \ && chmod +x /usr/local/bin/unoconv \ && ln -s /usr/bin/python3 /usr/bin/python diff --git a/solr/Dockerfile b/solr/Dockerfile index 0d4de9e..d1668f1 100644 --- a/solr/Dockerfile +++ b/solr/Dockerfile @@ -1,7 +1,6 @@ FROM alpine:3.7 MAINTAINER Disassembler - RUN \ # Install Java 1.8 JRE apk --no-cache add openjdk8-jre-base paxctl \ @@ -13,9 +12,11 @@ RUN \ RUN \ # Install runtime dependencies - apk --no-cache add bash lsof \ + apk --no-cache add bash lsof + +RUN \ # Download and install Solr - && wget http://archive.apache.org/dist/lucene/solr/6.5.1/solr-6.5.1.tgz -O /tmp/solr-6.5.1.tgz \ + wget http://archive.apache.org/dist/lucene/solr/6.5.1/solr-6.5.1.tgz -O /tmp/solr-6.5.1.tgz \ && mkdir /opt \ && tar xzf /tmp/solr-6.5.1.tgz -C /opt/ \ && mv /opt/solr-6.5.1 /opt/solr \