Skip to content

Running pkgdiff using docker #50

Description

@srbala

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions