Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running pkgdiff using docker #50

Open
srbala opened this issue Aug 9, 2022 · 0 comments
Open

Running pkgdiff using docker #50

srbala opened this issue Aug 9, 2022 · 0 comments

Comments

@srbala
Copy link

srbala commented Aug 9, 2022

This is more of notes, not an issue. can be added to the documentation. I had a requirement that needed run pkgdiff in jenkins step, and put together a Dockerfile for it. The community can use it too.

FROM fedora:36 as builder

ARG SYS_ROOT=/mnt/sys-root

RUN mkdir $SYS_ROOT; \
    dnf install \
    --installroot $SYS_ROOT \
    --releasever 36 \
    --nodocs -y \
    diffutils \
    gawk \
    perl-File-LibMagic \
    pkgdiff \
    wdiff \
    dpkg \
    binutils \
    tar \
    xz \
    gzip \
    which \
    java-17-openjdk-headless \
    abi-compliance-checker \
    abi-dumper; \
    dnf --installroot $SYS_ROOT clean all; 

# Some standard cleanup to reduce the size of image    
RUN rm -rf $SYS_ROOT/var/log/dnf* $SYS_ROOT/var/log/yum.* $SYS_ROOT/var/cache/dnf $SYS_ROOT/var/lib/dnf/repos; \
    rm -rf $SYS_ROOT/var/lib/dnf/history* $SYS_ROOT/var/log/hawkey.log $SYS_ROOT/boot $SYS_ROOT/dev/null $SYS_ROOT/run/*; \
    rm -f $SYS_ROOT/etc/machine-id; \
    touch $SYS_ROOT/etc/machine-id; \
    mkdir -p $SYS_ROOT/work

# Second stage build to reduce size
FROM scratch
COPY --from=builder /mnt/sys-root/ /

WORKDIR /work

ENTRYPOINT ["pkgdiff"]

CMD ["--help"]

Published image available at srbala/build-tools:pkgdiff from dockerhub.

docker pull srbala/build-tools:pkgdiff
docker run --privileged --rm -ti -v $PWD:/work srbala/build-tools:pkgdiff fileOld.tar.xz fileNew.tar.xz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant