From 2bb7cf2dffd8da870555967015d7d6074cd9d1b4 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Thu, 27 Sep 2018 12:34:05 +0200 Subject: [PATCH 01/11] Add the rest of the files --- Dockerfile | 20 ++++++++++++++++++++ README.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- extra-packages | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 Dockerfile create mode 100644 extra-packages diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1178f76 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM registry.fedoraproject.org/fedora:29 + +ENV NAME=fedora-toolbox VERSION=29 +LABEL com.redhat.component="$NAME" \ + name="$FGC/$NAME" \ + version="$VERSION" \ + usage="This image is meant to be used with the fedora-toolbox command" \ + summary="Base image for creating Fedora toolbox containers" \ + maintainer="Debarshi Ray " + +COPY README.md / + +RUN sed -i '/tsflags=nodocs/d' /etc/dnf/dnf.conf +RUN dnf -y swap coreutils-single coreutils-full + +COPY extra-packages / +RUN dnf -y install $(:30` that's specifically customised for your +host user. + +### Enter the Toolbox: +``` +[user@hostname fedora-toolbox]$ ./fedora-toolbox enter +🔹[user@toolbox ~]$ +``` -The fedora-toolbox package \ No newline at end of file diff --git a/extra-packages b/extra-packages new file mode 100644 index 0000000..bcfb241 --- /dev/null +++ b/extra-packages @@ -0,0 +1,37 @@ +bash-completion +bzip2 +diffutils +dnf-plugins-core +fpaste +findutils +git +gnupg +gnupg2-smime +hostname +iputils +jwhois +keyutils +less +lsof +man-db +man-pages +mlocate +mtr +openssh-clients +PackageKit-command-not-found +passwd +pigz +procps-ng +rsync +sudo +tcpdump +time +traceroute +tree +unzip +vte-profile +wget +which +words +xz +zip From c5723db31e6bc9eb0ba22ff2455a80d24be19627 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Mon, 25 Feb 2019 15:00:37 +0100 Subject: [PATCH 02/11] Synchronize with upstream --- Dockerfile | 2 +- README.md | 65 ++++++++++++++++++++++---------------------------- extra-packages | 2 +- 3 files changed, 31 insertions(+), 38 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1178f76..3a05740 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ ENV NAME=fedora-toolbox VERSION=29 LABEL com.redhat.component="$NAME" \ name="$FGC/$NAME" \ version="$VERSION" \ - usage="This image is meant to be used with the fedora-toolbox command" \ + usage="This image is meant to be used with the toolbox command" \ summary="Base image for creating Fedora toolbox containers" \ maintainer="Debarshi Ray " diff --git a/README.md b/README.md index 20e7fd3..b8b81a5 100644 --- a/README.md +++ b/README.md @@ -1,48 +1,41 @@ -# Fedora Toolbox — Hacking on your OSTree-based Fedora +# Toolbox — Unprivileged development environment -[Fedora Toolbox](https://github.com/debarshiray/fedora-toolbox) is a tool that -offers a familiar RPM based environment for developing and debugging software -on locked down [OSTree](https://ostree.readthedocs.io/en/latest/) based Fedora -systems like [Silverblue](https://silverblue.fedoraproject.org/). Such -operating systems are shipped as *immutable* OSTree images, where it's -difficult to setup a development environment with your favorite tools, editors -and SDKs. A toolbox container solves that problem by providing a RPM based -*mutable* container. You can tweak it to your heart's content and use DNF to -install your favorite packages, all without worrying about breaking your -operating system. +[Toolbox](https://github.com/debarshiray/toolbox) is a tool that offers a +familiar RPM based environment for developing and debugging software that runs +fully unprivileged using [Podman](https://podman.io/). -The toolbox environment is based on the `fedora-toolbox` image. This image is -then customized for the current user to create a toolbox container that -seamlessly integrates with the rest of the operating system. +The toolbox container is a fully *mutable* container; when you see +`yum install ansible` for example, that's something you can do inside your +toolbox container, without affecting the base operating system. + +This is particularly useful on +[OSTree](https://ostree.readthedocs.io/en/latest/) based Fedora systems like +[Silverblue](https://silverblue.fedoraproject.org/). The intention of these +systems is to discourage installation of software on the host, and instead +install software as (or in) containers. + +However this project doesn't *require* using an OSTree based system — it +works equally well if you're running e.g. existing Fedora Workstation or +Server, and that's a useful way to incrementally adopt containerization. + +The toolbox environment is based on an [OCI](https://www.opencontainers.org/) +image. On Fedora this is the `fedora-toolbox` image. This image is then +customized for the current user to create a toolbox container that seamlessly +integrates with the rest of the operating system. ## Usage -### Create the basic Fedora Toolbox image: +### Create your toolbox container: ``` -[user@hostname fedora-toolbox]$ buildah bud --tag fedora-toolbox:30 . -STEP 1: FROM docker://registry.fedoraproject.org/fedora:30 -Getting image source signatures -… -… -… -[user@hostname fedora-toolbox]$ -``` -Modify the Dockerfile to match your taste and Fedora version. The image should -be tagged as `fedora-toolbox` with a suffix matching the host Fedora version. -eg., `fedora-toolbox:30`, etc.. - -### Create your Fedora Toolbox container: -``` -[user@hostname fedora-toolbox]$ ./fedora-toolbox create -[user@hostname fedora-toolbox]$ +[user@hostname ~]$ toolbox create +[user@hostname ~]$ ``` This will create a container, and an image, called -`fedora-toolbox-:30` that's specifically customised for your -host user. +`fedora-toolbox-:` that's specifically customised +for your host user. -### Enter the Toolbox: +### Enter the toolbox: ``` -[user@hostname fedora-toolbox]$ ./fedora-toolbox enter +[user@hostname ~]$ toolbox enter 🔹[user@toolbox ~]$ ``` - diff --git a/extra-packages b/extra-packages index bcfb241..366a082 100644 --- a/extra-packages +++ b/extra-packages @@ -2,8 +2,8 @@ bash-completion bzip2 diffutils dnf-plugins-core -fpaste findutils +fpaste git gnupg gnupg2-smime From 447be5956fdfbc529f269cf838e9b8f9a0fe4736 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Mon, 25 Feb 2019 15:00:59 +0100 Subject: [PATCH 03/11] extra-packages: Add flatpak-xdg-utils --- extra-packages | 1 + 1 file changed, 1 insertion(+) diff --git a/extra-packages b/extra-packages index 366a082..09ba35d 100644 --- a/extra-packages +++ b/extra-packages @@ -3,6 +3,7 @@ bzip2 diffutils dnf-plugins-core findutils +flatpak-xdg-utils fpaste git gnupg From 70d73601c299b1b70b352ea8228082c7ddc9adbb Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Fri, 22 Mar 2019 11:57:26 +0100 Subject: [PATCH 04/11] Restore documentation removed from the base Fedora images https://github.com/debarshiray/toolbox/pull/55 --- Dockerfile | 4 ++++ missing-docs | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 missing-docs diff --git a/Dockerfile b/Dockerfile index 3a05740..9d8dee8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,10 @@ COPY README.md / RUN sed -i '/tsflags=nodocs/d' /etc/dnf/dnf.conf RUN dnf -y swap coreutils-single coreutils-full +COPY missing-docs / +RUN dnf -y reinstall $( Date: Fri, 22 Mar 2019 11:58:57 +0100 Subject: [PATCH 05/11] extra-packages: Add krb5-libs The krb5-libs package was added to the base toolbox images to ensure the presence of the /etc/krb5.conf.d directory with the correct permissions. Currently, the package is already pulled in by various dependencies. Therefore, it doesn't increase the size of the base image, but serves as a safeguard against any inadvertent changes. https://github.com/debarshiray/toolbox/pull/74 --- extra-packages | 1 + 1 file changed, 1 insertion(+) diff --git a/extra-packages b/extra-packages index 09ba35d..791f10f 100644 --- a/extra-packages +++ b/extra-packages @@ -12,6 +12,7 @@ hostname iputils jwhois keyutils +krb5-libs less lsof man-db From e22a095868472d4b0cb4cbe4527c35671df4961d Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Fri, 22 Mar 2019 12:00:01 +0100 Subject: [PATCH 06/11] Reduce the size by removing temporary files created by DNF For a locally built squashed fedora-toolbox:29 image [1], the size reported by 'podman images' goes from 630 MB to 425 MB. [1] Using: buildah bud --squash ... --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 9d8dee8..ef8cc7c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,4 +21,6 @@ COPY extra-packages / RUN dnf -y install $( Date: Fri, 22 Mar 2019 12:00:31 +0100 Subject: [PATCH 07/11] Synchronize with upstream --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b8b81a5..a602a07 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ This is particularly useful on systems is to discourage installation of software on the host, and instead install software as (or in) containers. -However this project doesn't *require* using an OSTree based system — it +However, this tool doesn't *require* using an OSTree based system — it works equally well if you're running e.g. existing Fedora Workstation or Server, and that's a useful way to incrementally adopt containerization. From 24c528695afff111148d2a5991a5c8d5a6cdbc6c Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Mon, 15 Apr 2019 18:00:39 +0200 Subject: [PATCH 08/11] Add label for tagging, not tied to the fedora-toolbox name Currently the toolbox script identifies toolbox images and containers by checking whether the com.redhat.component label matches "fedora-toolbox". However, as per the Fedora Container Guidelines [1], the com.redhat.com label should match the Red Hat Bugzilla component name where bugs against the image should be reported. This means that images derived from the base fedora-toolbox image would likely end up overwriting it. One option would've been to mandate that all toolbox images have the "fedora-toolbox-" prefix in their names. However, it's better to avoid putting limitations on how images can be named. The "fedora" name wouldn't anyway work for images based on other distributions, and not all images are going to use the Red Hat bugzilla for tracking bugs. It's better to use a tag that's uniquely associated with the toolbox project, and isn't tied to a particular distribution or bug tracker. [1] https://fedoraproject.org/wiki/Container:Guidelines --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ef8cc7c..0478478 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,8 @@ FROM registry.fedoraproject.org/fedora:29 ENV NAME=fedora-toolbox VERSION=29 -LABEL com.redhat.component="$NAME" \ +LABEL com.github.debarshiray.toolbox="true" \ + com.redhat.component="$NAME" \ name="$FGC/$NAME" \ version="$VERSION" \ usage="This image is meant to be used with the toolbox command" \ From da30032f5e8902ea9cd1e184827f7f00a7aa0763 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Thu, 11 Jul 2019 11:26:36 +0000 Subject: [PATCH 09/11] drop PackageKit-command-not-found (it connects to the host) --- extra-packages | 1 - 1 file changed, 1 deletion(-) diff --git a/extra-packages b/extra-packages index 791f10f..d48965e 100644 --- a/extra-packages +++ b/extra-packages @@ -20,7 +20,6 @@ man-pages mlocate mtr openssh-clients -PackageKit-command-not-found passwd pigz procps-ng From e2f6167a2bd9d26f6e5bbfe1218df4b76d1ce701 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Tue, 24 Sep 2019 20:10:54 +0200 Subject: [PATCH 10/11] Avoid losing useradd(8) by accident The shadow-utils package was added to the base toolbox images to ensure the presence of the useradd(8) command. Currently the package is already pulled in by various dependencies. Therefore, it doesn't increase the size of the base image, but serves as a safeguard against any inadvertent changes. --- extra-packages | 1 + 1 file changed, 1 insertion(+) diff --git a/extra-packages b/extra-packages index d48965e..c998b3f 100644 --- a/extra-packages +++ b/extra-packages @@ -24,6 +24,7 @@ passwd pigz procps-ng rsync +shadow-utils sudo tcpdump time From b2c70792f70eaea3ee62eee45b5e1e2c9ac220ae Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Thu, 10 Oct 2019 16:08:09 +0200 Subject: [PATCH 11/11] Update the label for tagging to reflect the project's new home https://github.com/containers/toolbox/pull/293 --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0478478..89977fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,8 @@ FROM registry.fedoraproject.org/fedora:29 ENV NAME=fedora-toolbox VERSION=29 -LABEL com.github.debarshiray.toolbox="true" \ +LABEL com.github.containers.toolbox="true" \ + com.github.debarshiray.toolbox="true" \ com.redhat.component="$NAME" \ name="$FGC/$NAME" \ version="$VERSION" \