From 2ba8273132a7b26b1a257614229d88776b7b45ba Mon Sep 17 00:00:00 2001 From: m2Giles <69128853+m2Giles@users.noreply.github.com> Date: Sat, 27 Apr 2024 20:01:06 -0400 Subject: [PATCH 1/2] feat: build ubuntu from upstream --- .github/workflows/build-ubuntu-toolbox.yml | 12 +- toolboxes/ubuntu-toolbox/Containerfile.ubuntu | 44 ++++--- toolboxes/ubuntu-toolbox/packages.ubuntu | 109 ++++++++++++------ 3 files changed, 104 insertions(+), 61 deletions(-) diff --git a/.github/workflows/build-ubuntu-toolbox.yml b/.github/workflows/build-ubuntu-toolbox.yml index 72b4fa2..bd5753d 100644 --- a/.github/workflows/build-ubuntu-toolbox.yml +++ b/.github/workflows/build-ubuntu-toolbox.yml @@ -29,12 +29,12 @@ jobs: - name: Checkout Push to Registry action uses: actions/checkout@v4 - - name: Verify Ubuntu toolbox - uses: EyeCantCU/cosign-action/verify@v0.2.2 - with: - containers: ubuntu-toolbox:22.04 - pubkey: https://raw.githubusercontent.com/toolbx-images/images/main/quay.io-toolbx-images.pub - registry: quay.io/toolbx-images + # - name: Verify Ubuntu toolbox + # uses: EyeCantCU/cosign-action/verify@v0.2.2 + # with: + # containers: ubuntu-toolbox:22.04 + # pubkey: https://raw.githubusercontent.com/toolbx-images/images/main/quay.io-toolbx-images.pub + # registry: quay.io/toolbx-images # Build metadata - name: Image Metadata diff --git a/toolboxes/ubuntu-toolbox/Containerfile.ubuntu b/toolboxes/ubuntu-toolbox/Containerfile.ubuntu index 5df0fcb..5dc4eb8 100644 --- a/toolboxes/ubuntu-toolbox/Containerfile.ubuntu +++ b/toolboxes/ubuntu-toolbox/Containerfile.ubuntu @@ -1,24 +1,32 @@ -FROM quay.io/toolbx-images/ubuntu-toolbox:22.04 -# From https://github.com/toolbx-images/images/tree/main/ubuntu/22.04 +FROM docker.io/library/ubuntu:24.04 +# FROM https://hub.docker.com/_/ubuntu LABEL com.github.containers.toolbox="true" \ - usage="This image is meant to be used with the toolbox or distrobox command" \ - summary="A cloud-native terminal experience powered by Ubuntu" \ - maintainer="jorge.castro@gmail.com" + name="ubuntu-toolbox" \ + usage="This image is meant to be used with the toolbox or distrobox command" \ + summary="A cloud-native terminal experience powered by Ubuntu" \ + maintainer="jorge.castro@gmail.com" COPY ./toolboxes/ubuntu-toolbox/packages.ubuntu /toolbox-packages -RUN apt-get update && \ - apt-get upgrade -y && \ +RUN rm /etc/apt/apt.conf.d/docker-gzip-indexes /etc/apt/apt.conf.d/docker-no-languages && \ + sed -Ei 's/^(hosts:.*)(\)\s*(.*)/\1\2 myhostname \3/' /etc/nsswitch.conf && \ + 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 | xargs) && \ - rm -rd /var/lib/apt/lists/* - -RUN rm /toolbox-packages - -RUN 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 - -RUN echo "ALL ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers \ No newline at end of file + ubuntu-minimal ubuntu-standard \ + libnss-myhostname \ + flatpak-xdg-utils \ + $(cat toolbox-packages | xargs) && \ + rm -rd /var/lib/apt/lists/* && \ + rm /toolbox-packages && \ + mkdir /usr/share/empty && \ + userdel --remove ubuntu && \ + rm /etc/apt/apt.conf.d/20apt-esm-hook.conf && \ + ln -s /usr/libexec/flatpak-xdg-utils/flatpak-spawn /usr/bin/ && \ + 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 && \ + echo "ALL ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers \ No newline at end of file diff --git a/toolboxes/ubuntu-toolbox/packages.ubuntu b/toolboxes/ubuntu-toolbox/packages.ubuntu index 8a141ed..60ac6da 100644 --- a/toolboxes/ubuntu-toolbox/packages.ubuntu +++ b/toolboxes/ubuntu-toolbox/packages.ubuntu @@ -1,56 +1,44 @@ +apt-utils +bash-completion bc +bzip2 +ca-certificates +curl dbus-x11 -direnv -fzf -libegl1-mesa -libgl1-mesa-glx -libvte-common -make -neofetch -plocate -progress -apt-utils dialog +diffutils +direnv dirmngr +findutils +fish +fzf gnupg +gnupg2 gnupg-l10n gnupg-utils -gnupg2 gpg -ca-certificates -libnsl2 -libpython3-stdlib gpg-agent +gpgconf +gpgsm gpg-wks-client gpg-wks-server -gpgsm -libksba8 -libnpth0 -libpython3.11-minimal -gpgconf -libnss-myhostname -libsqlite3-0 -libtirpc-common -libtirpc3 -libvte-2.91-common -openssl -lsof -pinentry-curses -time -libpython3.11-stdlib -libvulkan1 -media-types -mesa-vulkan-drivers +hostname +iproute2 +iputils-ping +keyutils +language-pack-en +less libbsd0 +libcap2-bin +libdrm2 libdrm-amdgpu1 libdrm-common libdrm-nouveau2 libdrm-radeon1 -libdrm2 libedit2 -libegl-mesa0 libegl1 libegl1-mesa +libegl-mesa0 libelf1 libexpat1 libgbm1 @@ -60,19 +48,36 @@ libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libglvnd0 -libglx-mesa0 libglx0 +libglx-mesa0 libicu70 +libkrb5-3 +libksba8 libllvm15 +libnpth0 +libnsl2 +libnss-mdns +libnss-myhostname libpciaccess0 -libsensors-config +libpython3.11-minimal +libpython3.11-stdlib +libpython3-stdlib libsensors5 +libsensors-config +libsqlite3-0 +libtirpc3 +libtirpc-common +libvte-2.91-common +libvte-2.9*-common +libvte-common +libvulkan1 libwayland-client0 libwayland-server0 libx11-6 libx11-data libx11-xcb1 libxau6 +libxcb1 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 @@ -81,9 +86,39 @@ libxcb-randr0 libxcb-shm0 libxcb-sync1 libxcb-xfixes0 -libxcb1 libxdmcp6 libxext6 libxfixes3 libxml2 +locales +lsof +make +man-db +manpages +media-types +mesa-vulkan-drivers +mtr +ncurses-base +neofetch +openssh-client +openssl +passwd pigz +pinentry-curses +plocate +procps +progress +rsync +sudo +tcpdump +time +traceroute +tree +tzdata +unzip +util-linux +wget +xauth +xz-utils +zip +zsh From 8ce5f5f14938e202b7ffdb87f8ddf152410d216a Mon Sep 17 00:00:00 2001 From: m2Giles <69128853+m2Giles@users.noreply.github.com> Date: Sat, 27 Apr 2024 20:05:54 -0400 Subject: [PATCH 2/2] fix: remove old packages --- toolboxes/ubuntu-toolbox/packages.ubuntu | 5 ----- 1 file changed, 5 deletions(-) diff --git a/toolboxes/ubuntu-toolbox/packages.ubuntu b/toolboxes/ubuntu-toolbox/packages.ubuntu index 60ac6da..7bed227 100644 --- a/toolboxes/ubuntu-toolbox/packages.ubuntu +++ b/toolboxes/ubuntu-toolbox/packages.ubuntu @@ -37,7 +37,6 @@ libdrm-nouveau2 libdrm-radeon1 libedit2 libegl1 -libegl1-mesa libegl-mesa0 libelf1 libexpat1 @@ -45,12 +44,10 @@ libgbm1 libgl1 libgl1-amber-dri libgl1-mesa-dri -libgl1-mesa-glx libglapi-mesa libglvnd0 libglx0 libglx-mesa0 -libicu70 libkrb5-3 libksba8 libllvm15 @@ -59,8 +56,6 @@ libnsl2 libnss-mdns libnss-myhostname libpciaccess0 -libpython3.11-minimal -libpython3.11-stdlib libpython3-stdlib libsensors5 libsensors-config