Skip to content

Instantly share code, notes, and snippets.

@Kungergely
Created January 3, 2020 17:02
Show Gist options
  • Save Kungergely/b83c1e87cd569500bfc01a0e4849beb4 to your computer and use it in GitHub Desktop.
Save Kungergely/b83c1e87cd569500bfc01a0e4849beb4 to your computer and use it in GitHub Desktop.
Bash script for building bindfs for CentOS 8 from the Fedora 31 src.rpm package using Docker
#!/bin/bash
wget http://download-ib01.fedoraproject.org/pub/fedora/linux/releases/31/Everything/source/tree/Packages/b/bindfs-1.14.1-2.fc31.src.rpm
cat > Dockerfile <<"EOF"
FROM centos:8
RUN mkdir -p /root/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} && mkdir -p /bindfs
RUN dnf -y --nogpgcheck install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm wget zip unzip bzip2 gcc gcc-c++ rpm-build make ruby valgrind fuse-devel
COPY bindfs-1.14.1-2.fc31.src.rpm /root/rpmbuild/
RUN cd /root/rpmbuild/ && \
rpmbuild --rebuild bindfs-1.14.1-2.fc31.src.rpm
EOF
docker build -t bindfs-builder .
mkdir build; cd build
docker run --mount type=bind,dst=/bindfs,src=`pwd` -t bindfs-builder:latest cp -r /root/rpmbuild/RPMS/x86_64 /bindfs
cp x86_64/* .
# Resulting packages:
# bindfs-1.14.1-2.el8.x86_64.rpm
# bindfs-debugsource-1.14.1-2.el8.x86_64.rpm
# bindfs-debuginfo-1.14.1-2.el8.x86_64.rpm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment