I'm using multi-stage builds to separate the build environment from the final docker image:
FROM ubuntu:bionic AS build
RUN apt-get update && apt-get install -y \
build-essential \
[...]
RUN wget https://someserver.com/somefile.tar.gz && \
tar xvzf somefile.tar.gz && \
./configure && \
make && make install && \
[missing part]
FROM ubuntu:bionic
COPY --from=build /tmp/fakeroot/ /
[...]
Is there an easy way to collect all files that where created/copied while make install
was running?
Currently I'm using a combination of ldd
and individual file copy to get them all:
cp /etc/xyz/* /tmp/fakeroot/xyz
cp --parents $(ldd /usr/sbin/nginx | grep -o '/.\+\.so[^ ]*' | sort | uniq) /tmp/fakeroot
But as make install already has the information of which file to copy to what directory I'm asking myself if there isn't any way to use this mechanism.
Thanks for any ideas!