Upgrade LibYAML version in container builds

This change installs libyaml from the source repo (currently at version
0.2.5), instead of the old versions from the Ubuntu mirrors (0.1.6-3 for
xenial and 0.1.7-2ubuntu3 for bionic).

https://github.com/yaml/libyaml
https://packages.ubuntu.com/xenial/libyaml-dev
https://packages.ubuntu.com/bionic/libyaml-dev

Change-Id: I72240fbd16adc07e4ce61761ea5453b0e34d331a
This commit is contained in:
Phil Sphicas 2020-09-25 08:02:04 +00:00
parent d883770ad9
commit 3b2e89c2fd
3 changed files with 45 additions and 6 deletions

View File

@ -34,8 +34,23 @@ RUN echo "deb ${UBUNTU_REPO} bionic main restricted universe multiverse" > /etc
COPY ./tools/baclient_build.sh /tmp/drydock/
COPY ./go /tmp/drydock/go
WORKDIR /tmp/drydock
RUN ./baclient_build.sh /tmp/drydock/go /tmp/drydock/baclient; \
rm -r /var/lib/apt/lists/*
RUN ./baclient_build.sh /tmp/drydock/go /tmp/drydock/baclient
# Build LibYAML
ARG LIBYAML_VERSION=0.2.5
RUN set -ex \
&& apt install -y git automake make libtool \
&& git clone https://github.com/yaml/libyaml.git \
&& cd libyaml \
&& git checkout $LIBYAML_VERSION \
&& ./bootstrap \
&& ./configure \
&& make \
&& make install \
&& cd .. \
&& rm -fr libyaml
RUN rm -r /var/lib/apt/lists/*
FROM ${FROM}
@ -72,6 +87,11 @@ WORKDIR /tmp/drydock
RUN ./hostdeps.sh; \
rm -r /var/lib/apt/lists/*
# Install LibYAML
ENV LD_LIBRARY_PATH=/usr/local/lib
COPY --from=baclient_builder /usr/local/lib /usr/local/lib
COPY --from=baclient_builder /usr/local/include/yaml.h /usr/local/include/yaml.h
COPY ./python/requirements-lock.txt /tmp/drydock/
RUN pip3 install \
--no-cache-dir \

View File

@ -34,8 +34,23 @@ RUN echo "deb ${UBUNTU_REPO} xenial main restricted universe multiverse" > /etc
COPY ./tools/baclient_build.sh /tmp/drydock/
COPY ./go /tmp/drydock/go
WORKDIR /tmp/drydock
RUN ./baclient_build.sh /tmp/drydock/go /tmp/drydock/baclient; \
rm -r /var/lib/apt/lists/*
RUN ./baclient_build.sh /tmp/drydock/go /tmp/drydock/baclient
# Build LibYAML
ARG LIBYAML_VERSION=0.2.5
RUN set -ex \
&& apt install -y git automake make libtool \
&& git clone https://github.com/yaml/libyaml.git \
&& cd libyaml \
&& git checkout $LIBYAML_VERSION \
&& ./bootstrap \
&& ./configure \
&& make \
&& make install \
&& cd .. \
&& rm -fr libyaml
RUN rm -r /var/lib/apt/lists/*
FROM ${FROM}
@ -59,7 +74,7 @@ ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
# Copy direct dependency requirements only to build a dependency layer
RUN echo "deb ${UBUNTU_REPO} xenial main restricted universe multiverse" > /etc/apt/sources.list; \
RUN echo "deb ${UBUNTU_REPO} xenial main restricted universe multiverse" > /etc/apt/sources.list; \
echo "deb ${UBUNTU_REPO} xenial-security main restricted universe multiverse" >> /etc/apt/sources.list; \
echo "deb ${UBUNTU_REPO} xenial-updates main restricted universe multiverse" >> /etc/apt/sources.list; \
cat /etc/apt/sources.list; \
@ -72,6 +87,11 @@ WORKDIR /tmp/drydock
RUN ./hostdeps.sh; \
rm -r /var/lib/apt/lists/*
# Install LibYAML
ENV LD_LIBRARY_PATH=/usr/local/lib
COPY --from=baclient_builder /usr/local/lib /usr/local/lib
COPY --from=baclient_builder /usr/local/include/yaml.h /usr/local/include/yaml.h
COPY ./python/requirements-lock.txt /tmp/drydock/
RUN pip3 install \
--no-cache-dir \

View File

@ -1,7 +1,6 @@
# These are host packages needed for Drydock
# that don't come on a minimal Ubuntu install
libvirt-dev
libyaml-dev
pkg-config
python3-dev
gcc