From 94f069a10d396db920f64d670e1643e6beb4efc7 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Wed, 26 Sep 2018 17:55:04 +0200 Subject: [PATCH 1/7] 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..aae970e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM registry.fedoraproject.org/fedora:28 + +ENV NAME=fedora-toolbox VERSION=28 +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 a8e8f3f404e46c199b10f6d2bb02323f3e43960b Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Mon, 25 Feb 2019 15:06:20 +0100 Subject: [PATCH 2/7] 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 aae970e..1a11f26 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ ENV NAME=fedora-toolbox VERSION=28 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 b6302f1a64f6573195ead48e2ddf42bd54bc2abd Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Fri, 22 Mar 2019 11:57:26 +0100 Subject: [PATCH 3/7] Restore documentation removed from the base Fedora images https://github.com/debarshiray/toolbox/pull/55 --- Dockerfile | 4 ++++ missing-docs | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 missing-docs diff --git a/Dockerfile b/Dockerfile index 1a11f26..f142b89 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 4/7] 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 366a082..3bd226a 100644 --- a/extra-packages +++ b/extra-packages @@ -11,6 +11,7 @@ hostname iputils jwhois keyutils +krb5-libs less lsof man-db From 9682f2fdf29413b6e1c943f6421f0701b89277d5 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Fri, 22 Mar 2019 12:00:01 +0100 Subject: [PATCH 5/7] 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 f142b89..a0af8a3 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 6/7] 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 c69eb1d2f58db4e941337fb4e2f18884d10c44c0 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Mon, 15 Apr 2019 18:00:39 +0200 Subject: [PATCH 7/7] 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 a0af8a3..b1285bf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,8 @@ FROM registry.fedoraproject.org/fedora:28 ENV NAME=fedora-toolbox VERSION=28 -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" \