Skip to content

Instantly share code, notes, and snippets.

@rene-d
Last active February 11, 2021 21:01
Show Gist options
  • Save rene-d/133bb941a809041e7d04e71fdc7f7f71 to your computer and use it in GitHub Desktop.
Save rene-d/133bb941a809041e7d04e71fdc7f7f71 to your computer and use it in GitHub Desktop.
Build a more recent version of fuse-overlayfs for CentOS7/RHEL7
FROM centos:7 AS builder
RUN yum -y install gcc clang cmake automake python3-pip make git gcc-c++ vim glibc-static
RUN pip3 install meson ninja
WORKDIR /src
RUN git clone -b fuse-3.6.1 https://github.com/libfuse/libfuse && \
cd libfuse && \
mkdir -p build && \
cd build && \
LDFLAGS="-lpthread" meson --prefix /usr -D default_library=static -Dexamples=false .. && \
ninja && \
ninja install
RUN git clone -b v1.1.2 https://github.com/containers/fuse-overlayfs && \
cd fuse-overlayfs && \
sh autogen.sh && \
LIBS="-ldl" LDFLAGS="-static" ./configure --prefix /usr && \
make && \
make install
FROM scratch
COPY --from=builder /usr/bin/fuse-overlayfs /bin/
COPY --from=builder /usr/bin/fusermount3 /bin/
COPY --from=builder /usr/sbin/mount.fuse3 /bin/
ENTRYPOINT [ "/bin/fuse-overlayfs", "-V" ]
# docker run --rm -ti $(docker build -q .)
# docker build -q -t fuse . && docker create --name fuse fuse && docker export fuse -o fuse.tar && docker container rm fuse && docker image rm fuse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment