From 1619380fdc7b69ad7fe6c61be0e664f3918a3590 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Tue, 4 Sep 2018 22:50:41 +0200 Subject: [PATCH] scripts --- basic-runtimes/ruby.sh | 34 ++++++++++++++++++++++++++++++++++ basic-runtimes/tomcat.sh | 11 +++++++++++ 2 files changed, 45 insertions(+) create mode 100644 basic-runtimes/ruby.sh create mode 100644 basic-runtimes/tomcat.sh diff --git a/basic-runtimes/ruby.sh b/basic-runtimes/ruby.sh new file mode 100644 index 0000000..282eb4d --- /dev/null +++ b/basic-runtimes/ruby.sh @@ -0,0 +1,34 @@ +# Install Ruby runtime dependencies +apk --no-cache add gdbm libressl readline zlib + +# 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 diff --git a/basic-runtimes/tomcat.sh b/basic-runtimes/tomcat.sh new file mode 100644 index 0000000..5fb20fa --- /dev/null +++ b/basic-runtimes/tomcat.sh @@ -0,0 +1,11 @@ +# Install Tomcat 8 +wget http://mirror.hosting90.cz/apache/tomcat/tomcat-8/v8.0.53/bin/apache-tomcat-8.0.53.tar.gz -O /tmp/apache-tomcat-8.tgz +tar xf /tmp/apache-tomcat-8.tgz -C /srv +mv /srv/apache-tomcat-8.0.53 /srv/tomcat + +# Make catalina.sh available globally +ln -s /srv/tomcat/bin/catalina.sh /usr/bin/catalina.sh + +# Cleanup +rm -rf /srv/tomcat/webapps/ROOT /srv/tomcat/webapps/docs /srv/tomcat/webapps/examples /srv/tomcat/webapps/host-manager /srv/tomcat/webapps/manager +rm -f /tmp/apache-tomcat-8.tgz