1 Answer
- Newest
- Most votes
- Most comments
0
I've finally figured out the problem. I'm going to post here in case this is helpful to others. It was helpful to see the shared object files using the ldd command. After seeing this, I figured I cold resolve this by install xz from source and include that as part of the layer.
Here are the steps I ran.
- Build the docker image - I gave it a tag of amzlinux2
$ docker build -t amzlinux2 .
- Next, run the container
$ docker run -it --rm -v "$PWD":/host amzlinux2 bash
- In the container we need to zip up the files so we can upload them as a layer
$ cd /opt && zip --symlinks -r /host/libxml2.zip ./*
-
At this point you'll have a libxml2.zip file on your host machine. You can upload this as a layer and add it to your function.
ldd
$ ldd /opt/bin/xmllint
linux-vdso.so.1 (0x00007ffcd9de0000)\
libxml2.so.2 => /opt/lib/libxml2.so.2 (0x00007ffb7f28f000)\
libdl.so.2 => /lib64/libdl.so.2 (0x00007ffb7f08b000)\
libz.so.1 => /lib64/libz.so.1 (0x00007ffb7ee75000)\
liblzma.so.5 => not found\
libm.so.6 => /lib64/libm.so.6 (0x00007ffb7eb2a000)\
libc.so.6 => /lib64/libc.so.6 (0x00007ffb7e774000)\
/lib64/ld-linux-x86-64.so.2 (0x00007ffb7f5e1000)\
liblzma.so.5 => not found\
Dockerfile
FROM amazon/lambda-build-node10.x
RUN yum -y upgrade && \
yum -y install gcc \
python-devel \
libxml2-devel \
libxslt-devel \
wget \
which \
tar \
gzip \
make \
zip
RUN wget http://xmlsoft.org/sources/libxml2-2.9.10.tar.gz
RUN gunzip -c libxml2-2.9.10.tar.gz | tar xvf -
RUN mkdir -p /host
RUN wget https://tukaani.org/xz/xz-5.2.4.tar.gz
RUN tar xvfz xz-5.2.4.tar.gz
RUN cd xz-5.2.4 && \
./configure --prefix=/opt && \
make && \
make install
RUN cd libxml2-2.9.10 && \
./configure --prefix=/opt \
--disable-static \
--with-python=/usr/bin/python3 && \
make && \
make install
answered 4 years ago
Relevant content
- asked 2 years ago
- asked 2 months ago
- asked 2 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 14 days ago
- AWS OFFICIALUpdated a year ago