Skip to content

Instantly share code, notes, and snippets.

@knqyf263
Last active May 3, 2019 18:08
Show Gist options
  • Save knqyf263/a50ae1962e5b2727409a427a9fce8dfa to your computer and use it in GitHub Desktop.
Save knqyf263/a50ae1962e5b2727409a427a9fce8dfa to your computer and use it in GitHub Desktop.
rpm debug

Run

$ docker build -t rpm .
$ docker run --name rpm --privileged --rm --cap-add=SYS_PTRACE --security-opt="seccomp=unconfined" -p 12345:12345 -it rpm
FROM centos:7
RUN yum -y update \
&& yum -y groupinstall "Development tools" \
&& yum -y install git vim openssl openssl-devel nspr nspr-devel nss nss-devel \
file file-devel popt popt-devel lua-static lua-devel db4 db4-devel wget tar \
libarchive libarchive-devel strace gdb-gdbserver libdb-devel lzma xz-devel
RUN git clone https://github.com/rpm-software-management/rpm.git \
&& cd rpm \
&& git checkout rpm-4.11.3-release \
&& ./autogen.sh --noconfigure \
&& sed -i -e 's/-g -O2/-g3 -O0/g' configure \
&& ./configure --with-external-db "CPPFLAGS=-I/usr/include/libdb -I/usr/include/nss3 -I/usr/include/nspr4" --enable-debug --with-lzma \
&& make \
&& make install \
&& mkdir -p /usr/local/var/lib/ \
&& cp -r /var/lib/rpm/ /usr/local/var/lib/
CMD ["gdbserver", ":12345", "/rpm/.libs/rpm", "-qa"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment