images: add ubuntu/26.04#1798
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new Containerfile and an extra-packages list to build an Ubuntu 26.04 base image for Toolbox containers. The review feedback highlights several opportunities to improve build robustness, such as correcting a typo in the metadata labels, using the -f flag with rm to prevent build failures if targeted files are missing, and safely deleting the ubuntu user only if it exists.
|
|
||
| # Remove apt configuration optimized for containers | ||
| # Remove docker-gzip-indexes to help with "command-not-found" | ||
| RUN rm /etc/apt/apt.conf.d/docker-gzip-indexes /etc/apt/apt.conf.d/docker-no-languages |
There was a problem hiding this comment.
|
|
||
| # Having anything in /home prevents toolbox from symlinking /var/home there, | ||
| # and 'ubuntu' user with UID 1000 will most likely conflict with host user as well | ||
| RUN userdel --remove ubuntu |
There was a problem hiding this comment.
If the ubuntu user does not exist in the base image (or is removed in a future upstream update), userdel will fail with a non-zero exit code, causing the image build to fail. It is safer to check if the user exists before attempting to delete it, or ignore the failure.
RUN id -u ubuntu &>/dev/null && userdel --remove ubuntu || true
| RUN userdel --remove ubuntu | ||
|
|
||
| # Disable APT ESM hook which tries to enable some systemd services on each apt invocation | ||
| RUN rm /etc/apt/apt.conf.d/20apt-esm-hook.conf |
debarshiray
left a comment
There was a problem hiding this comment.
Thanks a lot for adding the image definition for Ubuntu 26.04! I took a quick look at it, and it seems sane to me. I will wait a bit to hear from @Jmennius because he is our Ubuntu maintainer before merging it.
Meanwhile, I left some comments below; and could you please add the URL of this pull request to the commit message, and tweak it to something like this to match the format we use elsewhere:
.github/workflows, images/ubuntu: Add image definition for Ubuntu 26.04
containers#1798 Signed-off-by: Ferenc Géczi <ferenc.gm@gmail.com>
Thanks for the feedback, I have done the changes. PTAL. |
Add Ubuntu 26.04 image.