Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
Original 843MB, this version 342MB. I don't think we want any weak deps. If there is a such rpm we should require it explicitely. |
There was a problem hiding this comment.
Code Review
This pull request introduces a great optimization to the Containerfile to reduce the final image size by not installing documentation and weak dependencies. The change is effective and follows best practices for building minimal container images. I have provided one suggestion on how this could be made more robust for future modifications to the Containerfile by setting the dnf configuration globally.
Containerfile
Outdated
|
|
||
| RUN \ | ||
| dnf -y install mock koji dist-git-client patch python3-norpm python3-specfile redhat-rpm-config acl rpmautospec jq && \ | ||
| dnf -y --nodocs --setopt=install_weak_deps=False install mock koji dist-git-client patch python3-norpm python3-specfile redhat-rpm-config acl rpmautospec jq && \ |
There was a problem hiding this comment.
While adding the flags directly to the dnf install command works perfectly for the current state of the file, a more robust and maintainable approach is to configure these settings globally in /etc/dnf/dnf.conf. This ensures that any future dnf install commands added to this Containerfile will automatically benefit from these size-optimizing settings, preventing accidental bloat.
You could modify this RUN instruction to set this up at the beginning:
RUN echo 'install_weak_deps=False' >> /etc/dnf/dnf.conf && \
echo 'tsflags=nodocs' >> /etc/dnf/dnf.conf && \
dnf -y install ...Then, this dnf install command (and any future ones) would not need the explicit flags. This improves the long-term maintainability of the image definition.
|
nice! |
praiskup
left a comment
There was a problem hiding this comment.
I'm sure we'll need podman at least. mock recommends those:
btrfs-progs
buildah
dnf-utils
dnf5
dnf5-plugins
fuse-overlayfs
podman
python3-dnf
python3-dnf-plugins-core
yum
Since we rely on "bootstrap image" feature, dnf deps are not needed. Btrfs either.
|
I now checked that buildah isn't used (the plugin that relies on it isn't used in Konflux). We only depend on podman, but ... we might need skopeo (in the future, not now, because rpm-software-management/mock#1642 ). |
|
Added skopeo |
Containerfile
Outdated
|
|
||
| RUN \ | ||
| dnf -y install mock koji dist-git-client patch python3-norpm python3-specfile redhat-rpm-config acl rpmautospec jq && \ | ||
| dnf -y --nodocs --setopt=install_weak_deps=False install mock koji dist-git-client patch python3-norpm python3-specfile redhat-rpm-config acl rpmautospec jq skopeo && \ |
There was a problem hiding this comment.
I think we primarily need podman, but since rpm-software-management/mock#1717 skopeo can be kept
|
added also podman (plus linewrap) |
|
Needs rebase. |
Makes image smaller by 60%
14598e5 to
cc244dd
Compare
Makes image smaller by 60%