From 4270a3066875b364d7141880b5c7558cf7631f57 Mon Sep 17 00:00:00 2001 From: "Jorge O. Castro" Date: Mon, 1 May 2023 13:54:18 -0400 Subject: [PATCH 1/3] fix: update toolbox containerfile From: https://github.com/toolbx-images/images/blob/main/ubuntu/22.04/Containerfile --- Containerfile.toolbox | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/Containerfile.toolbox b/Containerfile.toolbox index 3adf461cadf..0ddd4cb5fa4 100644 --- a/Containerfile.toolbox +++ b/Containerfile.toolbox @@ -6,20 +6,37 @@ LABEL com.github.containers.toolbox="true" \ summary="A cloud-native terminal experience" \ maintainer="jorge.castro@gmail.com" +# 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 + +# Enable myhostname nss plugin for clean hostname resolution without patching +# hosts (at least for sudo), add it right after 'files' entry. We expect that +# this entry is not present yet. Do this early so that package postinst (which +# adds it too late in the order) skips this step +RUN sed -Ei 's/^(hosts:.*)(\)\s*(.*)/\1\2 myhostname \3/' /etc/nsswitch.conf + COPY toolbox-packages /toolbox-packages RUN sed -Ei '/apt-get (update|upgrade)/s/^/#/' /usr/local/sbin/unminimize && \ apt-get update && \ yes | /usr/local/sbin/unminimize && \ DEBIAN_FRONTEND=noninteractive apt-get -y install \ - $(cat /toolbox-packages) && \ + ubuntu-minimal ubuntu-standard \ + libnss-myhostname \ + $(cat toolbox-packages | xargs) && \ rm -rd /var/lib/apt/lists/* RUN rm /toolbox-packages +# Fix empty bind-mount to clear selinuxfs (see #337) +RUN mkdir /usr/share/empty + +# Add flatpak-spawn to /usr/bin +RUN ln -s /usr/libexec/flatpak-xdg-utils/flatpak-spawn /usr/bin/ + RUN ln -fs /bin/sh /usr/bin/sh && \ ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/docker && \ ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/flatpak && \ ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/podman && \ - ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/rpm-ostree && \ - ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/transactional-update + ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/rpm-ostree From 8b76f00f6af2cba912b6f43ea4954c1c51d8e063 Mon Sep 17 00:00:00 2001 From: "Jorge O. Castro" Date: Mon, 1 May 2023 13:57:30 -0400 Subject: [PATCH 2/3] fix: update Containerfile.toolbox --- Containerfile.toolbox | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/Containerfile.toolbox b/Containerfile.toolbox index 0ddd4cb5fa4..d672b1bc982 100644 --- a/Containerfile.toolbox +++ b/Containerfile.toolbox @@ -6,16 +6,6 @@ LABEL com.github.containers.toolbox="true" \ summary="A cloud-native terminal experience" \ maintainer="jorge.castro@gmail.com" -# 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 - -# Enable myhostname nss plugin for clean hostname resolution without patching -# hosts (at least for sudo), add it right after 'files' entry. We expect that -# this entry is not present yet. Do this early so that package postinst (which -# adds it too late in the order) skips this step -RUN sed -Ei 's/^(hosts:.*)(\)\s*(.*)/\1\2 myhostname \3/' /etc/nsswitch.conf - COPY toolbox-packages /toolbox-packages RUN sed -Ei '/apt-get (update|upgrade)/s/^/#/' /usr/local/sbin/unminimize && \ @@ -29,12 +19,6 @@ RUN sed -Ei '/apt-get (update|upgrade)/s/^/#/' /usr/local/sbin/unminimize && \ RUN rm /toolbox-packages -# Fix empty bind-mount to clear selinuxfs (see #337) -RUN mkdir /usr/share/empty - -# Add flatpak-spawn to /usr/bin -RUN ln -s /usr/libexec/flatpak-xdg-utils/flatpak-spawn /usr/bin/ - RUN ln -fs /bin/sh /usr/bin/sh && \ ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/docker && \ ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/flatpak && \ From 60a2951a660fdd68a8e1842db6ff2758eca3453f Mon Sep 17 00:00:00 2001 From: "Jorge O. Castro" Date: Mon, 1 May 2023 13:59:02 -0400 Subject: [PATCH 3/3] fix: update Containerfile.toolbox These packages are already on the image --- Containerfile.toolbox | 2 -- 1 file changed, 2 deletions(-) diff --git a/Containerfile.toolbox b/Containerfile.toolbox index d672b1bc982..6b9ead96480 100644 --- a/Containerfile.toolbox +++ b/Containerfile.toolbox @@ -12,8 +12,6 @@ RUN sed -Ei '/apt-get (update|upgrade)/s/^/#/' /usr/local/sbin/unminimize && \ apt-get update && \ yes | /usr/local/sbin/unminimize && \ DEBIAN_FRONTEND=noninteractive apt-get -y install \ - ubuntu-minimal ubuntu-standard \ - libnss-myhostname \ $(cat toolbox-packages | xargs) && \ rm -rd /var/lib/apt/lists/*