From 9f2c177d1a0d7bb33387eeb2dbcb109ab8916a90 Mon Sep 17 00:00:00 2001 From: John Cai Date: Tue, 7 May 2019 11:44:15 -0700 Subject: [PATCH] Install pcre2 --- Dockerfile.custom | 7 +++++++ scripts/install-git | 2 +- scripts/install-pcre2 | 15 +++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100755 scripts/install-pcre2 diff --git a/Dockerfile.custom b/Dockerfile.custom index 0f46c81..fe80922 100644 --- a/Dockerfile.custom +++ b/Dockerfile.custom @@ -15,6 +15,13 @@ ENV PATH $PATH:/usr/local/go/bin # Git ARG GIT_VERSION + +## pcre +ARG PCRE2_VERSION=10.33 +ARG PCRE2_DOWNLOAD_URL=https://ftp.pcre.org/pub/pcre/pcre2-${PCRE2_VERSION}.tar.gz +RUN if [ -n "$GIT_VERSION" ]; then /scripts/install-pcre2 && pcre2-config --version; fi + +## git ARG GIT_DOWNLOAD_URL=https://www.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz ARG GIT_DOWNLOAD_SHA256 RUN if [ -n "$GIT_VERSION" ]; then /scripts/install-git && git --version; fi diff --git a/scripts/install-git b/scripts/install-git index ed489b7..3c5bd6f 100755 --- a/scripts/install-git +++ b/scripts/install-git @@ -9,7 +9,7 @@ mkdir build \ && tar -C build -xzf git.tar.gz \ && cd build/git-$GIT_VERSION \ && chmod +x configure \ - && USE_LIBPCRE=YesPlease ./configure --with-libpcre \ + && ./configure --with-libpcre \ && make all \ && make install PREFIX=/usr/local \ && cd ../.. \ diff --git a/scripts/install-pcre2 b/scripts/install-pcre2 new file mode 100755 index 0000000..10065be --- /dev/null +++ b/scripts/install-pcre2 @@ -0,0 +1,15 @@ +#!/bin/bash + +set -xeuo pipefail +IFS=$'\n\t' + +curl -fsSL "$PCRE2_DOWNLOAD_URL" -o pcre2.tar.gz \ + && tar -xzf pcre2.tar.gz \ + && cd pcre2-${PCRE2_VERSION} \ + && chmod +x configure \ + && ./configure --prefix=/usr --enable-jit \ + && make \ + && make install \ + && cd ../ \ + && rm -rf pcre2-${PCRE2_VERSION} \ + && rm pcre2.tar.gz