From 6bec5b5e55b9b8dbe153ba986832a1b0faa6ac9a Mon Sep 17 00:00:00 2001 From: Disassembler Date: Fri, 16 Mar 2018 17:30:11 +0100 Subject: [PATCH] Use ruby image as base for CrisisCleanup --- crisiscleanup.sh | 1 + crisiscleanup/Dockerfile | 37 +++---------------------------------- 2 files changed, 4 insertions(+), 34 deletions(-) diff --git a/crisiscleanup.sh b/crisiscleanup.sh index 155caa6..11296a8 100755 --- a/crisiscleanup.sh +++ b/crisiscleanup.sh @@ -5,6 +5,7 @@ SOURCE_DIR=$(realpath $(dirname "${0}"))/crisiscleanup # Check prerequisites docker image ls | grep -q postfix || $(realpath $(dirname "${0}"))/postfix.sh docker image ls | grep -q postgres || $(realpath $(dirname "${0}"))/postgres.sh +docker image ls | grep -q ruby || $(realpath $(dirname "${0}"))/ruby.sh # Build Docker container docker build -t crisiscleanup ${SOURCE_DIR} diff --git a/crisiscleanup/Dockerfile b/crisiscleanup/Dockerfile index 914db48..2e93389 100644 --- a/crisiscleanup/Dockerfile +++ b/crisiscleanup/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.7 +FROM ruby MAINTAINER Disassembler RUN \ @@ -9,43 +9,12 @@ RUN \ # Cleanup && apk --no-cache del paxctl -RUN \ - # Install Ruby runtime dependencies - 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 - && wget http://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.6.tar.xz -O ruby.tar.xz \ - && mkdir -p /usr/src/ruby \ - && tar -xJf ruby.tar.xz -C /usr/src/ruby --strip-components=1 \ - && rm ruby.tar.xz \ - && cd /usr/src/ruby \ - # Hackfix to suppress "Insecure world writable dir" warning - && sed -ni 'p;13a #define ENABLE_PATH_CHECK 0' file.c \ - # Configure compilation + hackfix to detect isnan/isinf macros - && autoconf \ - && ac_cv_func_isnan=yes ac_cv_func_isinf=yes ./configure --build=x86_64-linux-musl --disable-install-doc --enable-shared \ - # Compile and install Ruby - && make -j $(nproc) \ - && make install \ - # Install RubyGems and Bundler - && mkdir -p /usr/local/etc \ - && echo -e 'install: --no-document\nupdate: --no-document' >/usr/local/etc/gemrc \ - && gem update --system \ - # Cleanup - && cd /tmp \ - && rm -r /usr/src/ruby \ - && apk --no-cache del .deps \ - && rm -rf /root/.gem - -ENV RAILS_ENV production - RUN \ # Install runtime dependencies apk --no-cache add libpq libxml2 libxslt tzdata +ENV RAILS_ENV production + RUN \ # Install build dependencies apk --no-cache add --virtual .deps build-base git libxml2-dev libxslt-dev linux-headers postgresql-dev yarn zlib-dev \