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
This commit is contained in:
Phil Sphicas 2020-09-25 07:11:39 +00:00
parent 0c3aff1ba1
commit a968918d84
3 changed files with 46 additions and 0 deletions

View File

@ -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/

View File

@ -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 \

View File

@ -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 \