From a968918d8452053bc8777a14dd39f901e6460633 Mon Sep 17 00:00:00 2001 From: Phil Sphicas Date: Fri, 25 Sep 2020 07:11:39 +0000 Subject: [PATCH] Include LibYAML in container builds Updates Dockerfiles to build the LibYAML library, which can provide much faster YAML parsing and emitting than the native Python library. https://pyyaml.org/wiki/LibYAML Change-Id: I3e739f6426f6fe7303765192749fc0a43b60f9a8 --- images/armada/Dockerfile.opensuse_15 | 16 ++++++++++++++++ images/armada/Dockerfile.ubuntu_bionic | 15 +++++++++++++++ images/armada/Dockerfile.ubuntu_xenial | 15 +++++++++++++++ 3 files changed, 46 insertions(+) diff --git a/images/armada/Dockerfile.opensuse_15 b/images/armada/Dockerfile.opensuse_15 index 0a77d738..e4069a63 100644 --- a/images/armada/Dockerfile.opensuse_15 +++ b/images/armada/Dockerfile.opensuse_15 @@ -28,9 +28,11 @@ RUN mkdir -p /armada && \ python3-devel \ python3-setuptools \ python3-pip \ + automake \ gcc \ git \ libopenssl-devel \ + libtool \ make RUN pip3 install --upgrade pip && \ @@ -42,6 +44,20 @@ RUN pip3 install --upgrade pip && \ /usr/share/doc \ /usr/share/doc-base +ENV LD_LIBRARY_PATH=/usr/local/lib + +ARG LIBYAML_VERSION=0.2.5 +RUN set -ex \ + && git clone https://github.com/yaml/libyaml.git \ + && cd libyaml \ + && git checkout $LIBYAML_VERSION \ + && ./bootstrap \ + && ./configure \ + && make \ + && make install \ + && cd .. \ + && rm -fr libyaml + WORKDIR /armada COPY requirements.txt /tmp/ diff --git a/images/armada/Dockerfile.ubuntu_bionic b/images/armada/Dockerfile.ubuntu_bionic index 05c256ea..46ac61f0 100644 --- a/images/armada/Dockerfile.ubuntu_bionic +++ b/images/armada/Dockerfile.ubuntu_bionic @@ -43,17 +43,32 @@ CMD ["server"] COPY requirements.txt ./ +ENV LD_LIBRARY_PATH=/usr/local/lib + +ARG LIBYAML_VERSION=0.2.5 + # Build RUN set -ex \ && buildDeps=' \ + automake \ gcc \ libssl-dev \ + libtool \ make \ python3-pip \ ' \ && apt-get -qq update \ # Keep git separate so it's not removed below && apt-get install -y $buildDeps git --no-install-recommends \ + && git clone https://github.com/yaml/libyaml.git \ + && cd libyaml \ + && git checkout $LIBYAML_VERSION \ + && ./bootstrap \ + && ./configure \ + && make \ + && make install \ + && cd .. \ + && rm -fr libyaml \ && python3 -m pip install -U pip \ && pip3 install -r requirements.txt --no-cache-dir \ && apt-get purge -y --auto-remove $buildDeps \ diff --git a/images/armada/Dockerfile.ubuntu_xenial b/images/armada/Dockerfile.ubuntu_xenial index 989b949e..e94653f5 100644 --- a/images/armada/Dockerfile.ubuntu_xenial +++ b/images/armada/Dockerfile.ubuntu_xenial @@ -43,17 +43,32 @@ CMD ["server"] COPY requirements.txt ./ +ENV LD_LIBRARY_PATH=/usr/local/lib + +ARG LIBYAML_VERSION=0.2.5 + # Build RUN set -ex \ && buildDeps=' \ + automake \ gcc \ libssl-dev \ + libtool \ make \ python3-pip \ ' \ && apt-get -qq update \ # Keep git separate so it's not removed below && apt-get install -y $buildDeps git --no-install-recommends \ + && git clone https://github.com/yaml/libyaml.git \ + && cd libyaml \ + && git checkout $LIBYAML_VERSION \ + && ./bootstrap \ + && ./configure \ + && make \ + && make install \ + && cd .. \ + && rm -fr libyaml \ && python3 -m pip install -U pip \ && pip3 install -r requirements.txt --no-cache-dir \ && apt-get purge -y --auto-remove $buildDeps \