From 06beac724c8f53ea40255837df4c21f16f921c56 Mon Sep 17 00:00:00 2001 From: Justin Garrison Date: Tue, 10 Dec 2024 11:46:02 -0800 Subject: [PATCH] debian: add debian toolbox based on ubuntu --- README.md | 4 +- toolboxes/debian-toolbox/Containerfile.debian | 32 +++++ toolboxes/debian-toolbox/packages.debian | 118 ++++++++++++++++++ 3 files changed, 153 insertions(+), 1 deletion(-) create mode 100644 toolboxes/debian-toolbox/Containerfile.debian create mode 100644 toolboxes/debian-toolbox/packages.debian diff --git a/README.md b/README.md index 4c95fc4..fb535f8 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Centralized repository of containers designed for Toolbox/Distrobox with batteri ## Images - `ubuntu-toolbox` - an Ubuntu base image +- `debian-toolbox` - a Debian base image - `fedora-toolbox` - a Fedora base image - `wolfi-toolbox` - a WolfiOS base image - `bluefin-cli` - a WolfiOS based image with Homebrew and a strongly opinionated default experience @@ -60,7 +61,8 @@ Both `bluefin-cli` and `wolfi-toolbox` have Wolfi developer variants built from `powershell-toolbox` is based on `WolfiOS`. Its primary purpose is to be a dedicated container for Microsoft related technologies used during development. It contains [PowerShell](https://github.com/PowerShell/PowerShell), [Azure CLI](https://github.com/Azure/azure-cli) and [.NET](https://github.com/dotnet/core) (latest LTS) configured out of the box. It also includes a small selection of other useful CLI utilities to improve the overall experience. ### Incus and Docker Distrobox -Both `incus-distrobox` and `docker-distrobox` are designed to be run with a rootful, init distrobox. [Incus](https://linuxcontainers.org/incus/) uses packages built by [Zabbly](https://github.com/zabbly/incus). [Docker](https://www.docker.com/) uses the [convience install script](https://docs.docker.com/engine/install/ubuntu/#install-using-the-convenience-script) from Docker. Both are built from the ubuntu-toolbox built in this repo. Example distrobox-assemble files are with each of them. Both work well with a volume mount for their respective files in `/var/lib/{docker,incus}`. Both can be setup to autostart on boot with a `systemd service`. However, your user sockets for `Xorg`, `Wayland`, and `Pulseaudio` will not be setup until you login. For the `docker-distrobox` you can customize the group of the exported `docker socket` by setting an environment variable at distrobox creation time for `DOCKERGROUP`. The assemble file has more information. Both the `incus-distrobox` and `docker-distrobox` set the unix-groups. For incus, matching `incus-admin` inside the distrobox and on the host will enable you to use the `incus socket` from the host. + +Both `incus-distrobox` and `docker-distrobox` are designed to be run with a rootful, init distrobox. [Incus](https://linuxcontainers.org/incus/) uses packages built by [Zabbly](https://github.com/zabbly/incus). [Docker](https://www.docker.com/) uses the [convience install script](https://docs.docker.com/engine/install/ubuntu/#install-using-the-convenience-script) from Docker. Both are built from the ubuntu-toolbox built in this repo. Example distrobox-assemble files are with each of them. Both work well with a volume mount for their respective files in `/var/lib/{docker,incus}`. Both can be setup to autostart on boot with a `systemd service`. However, your user sockets for `Xorg`, `Wayland`, and `Pulseaudio` will not be setup until you login. For the `docker-distrobox` you can customize the group of the exported `docker socket` by setting an environment variable at distrobox creation time for `DOCKERGROUP`. The assemble file has more information. Both the `incus-distrobox` and `docker-distrobox` set the unix-groups. For incus, matching `incus-admin` inside the distrobox and on the host will enable you to use the `incus socket` from the host. # Stats diff --git a/toolboxes/debian-toolbox/Containerfile.debian b/toolboxes/debian-toolbox/Containerfile.debian new file mode 100644 index 0000000..d7494e9 --- /dev/null +++ b/toolboxes/debian-toolbox/Containerfile.debian @@ -0,0 +1,32 @@ +FROM docker.io/library/ubuntu:24.04 +# FROM https://hub.docker.com/_/ubuntu + +LABEL com.github.containers.toolbox="true" \ + 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 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 && \ + apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get -y install \ + 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 && \ + curl -sLo /usr/bin/host-spawn https://github.com/1player/host-spawn/releases/download/1.5.0/host-spawn-x86_64 && \ + chmod +x /usr/bin/host-spawn && \ + 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 diff --git a/toolboxes/debian-toolbox/packages.debian b/toolboxes/debian-toolbox/packages.debian new file mode 100644 index 0000000..4f65939 --- /dev/null +++ b/toolboxes/debian-toolbox/packages.debian @@ -0,0 +1,118 @@ +apt-utils +bash-completion +bc +bzip2 +ca-certificates +curl +dbus-x11 +dialog +diffutils +direnv +dirmngr +findutils +fish +fzf +git +gnupg +gnupg2 +gnupg-l10n +gnupg-utils +gpg +gpg-agent +gpgconf +gpgsm +gpg-wks-client +gpg-wks-server +hostname +iproute2 +iputils-ping +keyutils +less +libbsd0 +libcap2-bin +libdrm2 +libdrm-amdgpu1 +libdrm-common +libdrm-nouveau2 +libdrm-radeon1 +libedit2 +libegl-mesa0 +libelf1 +libexpat1 +libgbm1 +libgl1 +libgl1-mesa-dri +libglapi-mesa +libglib2.0-bin +libglvnd0 +libglx0 +libglx-mesa0 +libkrb5-3 +libksba8 +libllvm15 +libnpth0 +libnsl2 +libnss-mdns +libnss-myhostname +libpciaccess0 +libpython3-stdlib +libsensors5 +libsensors-config +libsqlite3-0 +libtirpc3 +libtirpc-common +libvte-2.91-common +libvte-common +libvulkan1 +libwayland-client0 +libwayland-server0 +libx11-6 +libx11-data +libx11-xcb1 +libxau6 +libxcb1 +libxcb-dri2-0 +libxcb-dri3-0 +libxcb-glx0 +libxcb-present0 +libxcb-randr0 +libxcb-shm0 +libxcb-sync1 +libxcb-xfixes0 +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 +software-properties-common +sudo +tcpdump +time +traceroute +tree +tzdata +unzip +util-linux +wget +xauth +xz-utils +zip +zsh