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

dnf clean after dnf install in Dockerfiles #948

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Dockerfile.el8
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ RUN ( \
dnf install -y rpm-build rpmlint python3-pip python3-virtualenv rubygem-ronn \
dnf-plugins-core 'dnf-command(config-manager)' \
'dnf-command(builddep)' sudo rsync rpmdevtools; \
dnf config-manager --set-enabled powertools;
dnf config-manager --set-enabled powertools; \
dnf clean all;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This clean all is not needed, it slows down the second dnf install below

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be! Depends on the network environment and the upstream server being used.

The better way may be to merge those installs, so that the process will be fast, and the image will be slow?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just getting back to this, i think the containers referenced are gone. The fedora and el9 containers are only used to build an rpm and then exit. Your change can be applied to them if you want, but as the last entry after last install


COPY packaging/redhat/python-apprise.spec /
# Place our build file into the path
COPY bin/build-rpm.sh /usr/bin
RUN rpmspec -q --buildrequires /python-apprise.spec | cut -f1 -d' ' | \
xargs dnf install -y
xargs dnf install -y; \
dnf clean all;

# RPM Build Structure Setup
ENV FLAVOR=rpmbuild OS=centos DIST=el8
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile.el9
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ RUN ( \
dnf install -y rpm-build rpmlint python3-pip rubygem-ronn \
dnf-plugins-core 'dnf-command(config-manager)' \
'dnf-command(builddep)' sudo rsync rpmdevtools; \
dnf config-manager --set-enabled crb;
dnf config-manager --set-enabled crb; \
dnf clean all;

COPY packaging/redhat/python-apprise.spec /
# Place our build file into the path
COPY bin/build-rpm.sh /usr/bin
RUN rpmspec -q --buildrequires /python-apprise.spec | cut -f1 -d' ' | \
xargs dnf install -y
xargs dnf install -y; \
dnf clean all;

# RPM Build Structure Setup
ENV FLAVOR=rpmbuild OS=centos DIST=el8
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile.f37
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@
dnf install -y epel-release; \
dnf install -y rpm-build rpmlint python3-pip rubygem-ronn \
dnf-plugins-core 'dnf-command(config-manager)' \
'dnf-command(builddep)' sudo rsync rpmdevtools;
'dnf-command(builddep)' sudo rsync rpmdevtools; \
dnf clean all;

COPY packaging/redhat/python-apprise.spec /
# Place our build file into the path
COPY bin/build-rpm.sh /usr/bin
RUN rpmspec -q --buildrequires /python-apprise.spec | cut -f1 -d' ' | \
xargs dnf install -y
xargs dnf install -y; \
dnf clean all;

# RPM Build Structure Setup
ENV FLAVOR=rpmbuild OS=centos DIST=el8
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile.f39
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@
dnf install -y \
rpm-build rpmlint python3-pip rubygem-ronn \
dnf-plugins-core 'dnf-command(config-manager)' \
'dnf-command(builddep)' sudo rsync rpmdevtools;
'dnf-command(builddep)' sudo rsync rpmdevtools; \
dnf clean all;

COPY packaging/redhat/python-apprise.spec /
# Place our build file into the path
COPY bin/build-rpm.sh /usr/bin
RUN rpmspec -q --buildrequires /python-apprise.spec | cut -f1 -d' ' | \
xargs dnf install -y
xargs dnf install -y; \
dnf clean all;

# RPM Build Structure Setup
ENV FLAVOR=rpmbuild OS=centos DIST=f39
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile.rawhide
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ RUN \
dnf install -y \
rpm-build rpmlint python3-pip rubygem-ronn \
dnf-plugins-core 'dnf-command(config-manager)' \
'dnf-command(builddep)' sudo rsync rpmdevtools;
'dnf-command(builddep)' sudo rsync rpmdevtools; \
dnf clean all;

COPY packaging/redhat/python-apprise.spec /
# Place our build file into the path
COPY bin/build-rpm.sh /usr/bin
RUN rpmspec -q --buildrequires /python-apprise.spec | cut -f1 -d' ' | \
xargs dnf install -y
xargs dnf install -y; \
dnf clean all;

# RPM Build Structure Setup
ENV FLAVOR=rpmbuild OS=centos DIST=rawhide
Expand Down