From 7c17e4103b1772805e26058c055569e1fb1087d9 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 13 Feb 2019 23:08:39 +0000 Subject: [PATCH 1/3] Simplify 'make' usage --- .drone.yml | 1 + Dockerfile | 16 +++++++--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.drone.yml b/.drone.yml index 73236d1..797616a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,6 +3,7 @@ pipeline: image: spritsail/docker-build volumes: [ '/var/run/docker.sock:/var/run/docker.sock' ] repo: plex-dev + make: true test-bin: image: spritsail/docker-test diff --git a/Dockerfile b/Dockerfile index 7a1f0f7..ccab68e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,8 @@ ARG XMLSTAR_VER ARG LIBRE_VER=2.8.2 ARG CURL_VER +ARG MAKEFLAGS=-j2 + RUN apt-get -y update \ && apt-get -y install zlib1g-dev @@ -34,8 +36,7 @@ RUN git clone https://gitlab.gnome.org/GNOME/libxml2.git --branch $LIBXML2_VER - --without-legacy \ --without-modules \ --without-python \ - && make -j$(nproc) \ - && make -j$(nproc) DESTDIR=/prefix install + && make DESTDIR=/prefix install # Download and build libxslt WORKDIR /tmp/libxslt @@ -46,8 +47,7 @@ RUN git clone https://gitlab.gnome.org/GNOME/libxslt.git --branch $LIBXSLT_VER - --without-crypto \ --without-plugins \ --without-python \ - && make -j$(nproc) \ - && make -j$(nproc) DESTDIR=/prefix install + && make DESTDIR=/prefix install # Download and build xmlstarlet ADD xmlstarlet-*.patch /tmp @@ -60,8 +60,7 @@ RUN git clone git://git.code.sf.net/p/xmlstar/code --branch $XMLSTAR_VER --depth --disable-build-docs \ --with-libxml-prefix=/prefix/usr \ --with-libxslt-prefix=/prefix/usr \ - && make -j$(nproc) \ - && make -j$(nproc) DESTDIR=/prefix install + && make DESTDIR=/prefix install # Download and build LibreSSL as a cURL dependency WORKDIR /tmp/libressl @@ -69,7 +68,7 @@ RUN curl -sSL https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${LIBRE_VER} | tar xz --strip-components=1 \ # Install to the default system directories so cURL can find it && ./configure --prefix=/usr \ - && make -j$(nproc) install + && make install # Download and build curl WORKDIR /tmp/curl @@ -109,8 +108,7 @@ RUN git clone https://github.com/curl/curl.git --branch $CURL_VER --depth 1 . \ --without-libpsl \ --without-librtmp \ --without-winidn \ - && make -j$(nproc) \ - && make -j$(nproc) DESTDIR=/prefix install + && make DESTDIR=/prefix install WORKDIR /prefix From 19662b1707377024cb7a1ccfcc7cd90fcd5ced4a Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 13 Feb 2019 23:09:11 +0000 Subject: [PATCH 2/3] Remove all versions of bundled libs --- Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index ccab68e..6cb4e40 100644 --- a/Dockerfile +++ b/Dockerfile @@ -124,11 +124,11 @@ RUN curl -fsSL http://ftp.de.debian.org/debian/pool/main/g/gcc-${LIBSTDCPP_VER:0 && rm -f \ "Plex Media Server Tests" \ MigratePlexServerConfig.sh \ - libcrypto.so.1.0.0 \ - libcurl.so.4 \ - libssl.so.1.0.0 \ - libxml2.so.2 \ - libxslt.so.1 \ + libcrypto.so* \ + libcurl.so* \ + libssl.so* \ + libxml2.so* \ + libxslt.so* \ Resources/start.sh \ # Place shared libraries in usr/lib so they can be actually shared && mv *.so* ../ From 81fc0fa0d299b87d9e1c6cf4b1bfa942948a9fe3 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 13 Feb 2019 23:10:42 +0000 Subject: [PATCH 3/3] Build zlib from source --- Dockerfile | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6cb4e40..6269904 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,7 @@ ARG LIBSTDCPP_VER=6.3.0-18+deb9u1 ARG LIBGCC1_VER=6.3.0-18+deb9u1 ARG XMLSTAR_VER=1.6.1 ARG CURL_VER=curl-7_64_0 +ARG ZLIB_VER=1.2.11 FROM spritsail/debian-builder:stretch-slim as builder @@ -16,17 +17,25 @@ ARG LIBXSLT_VER=v1.1.32 ARG XMLSTAR_VER ARG LIBRE_VER=2.8.2 ARG CURL_VER +ARG ZLIB_VER ARG MAKEFLAGS=-j2 -RUN apt-get -y update \ - && apt-get -y install zlib1g-dev +# Download and build zlib +WORKDIR /tmp/zlib +RUN curl -sSf https://www.zlib.net/zlib-$ZLIB_VER.tar.xz \ + | tar xJ --strip-components=1 \ + && ./configure \ + --prefix=/usr \ + --shared \ + && make DESTDIR=/prefix install # Download and build libxml2 WORKDIR /tmp/libxml2 RUN git clone https://gitlab.gnome.org/GNOME/libxml2.git --branch $LIBXML2_VER --depth 1 . \ && ./autogen.sh \ --prefix=/usr \ + --with-zlib=/prefix/usr \ --without-catalog \ --without-docbook \ --without-ftp \ @@ -43,6 +52,7 @@ WORKDIR /tmp/libxslt RUN git clone https://gitlab.gnome.org/GNOME/libxslt.git --branch $LIBXSLT_VER --depth 1 . \ && ./autogen.sh \ --prefix=/usr \ + --with-zlib=/prefix/usr \ --with-libxml-src="../libxml2" \ --without-crypto \ --without-plugins \ @@ -82,7 +92,7 @@ RUN git clone https://github.com/curl/curl.git --branch $CURL_VER --depth 1 . \ --enable-versioned-symbols \ --enable-threaded-resolver \ --with-ssl \ - --with-zlib \ + --with-zlib=/prefix/usr \ --disable-crypto-auth \ --disable-curldebug \ --disable-dependency-tracking \ @@ -129,6 +139,7 @@ RUN curl -fsSL http://ftp.de.debian.org/debian/pool/main/g/gcc-${LIBSTDCPP_VER:0 libssl.so* \ libxml2.so* \ libxslt.so* \ + libz.so* \ Resources/start.sh \ # Place shared libraries in usr/lib so they can be actually shared && mv *.so* ../