Toolbx

Sebagai host yang immutable, Fedora Silverblue adalah platform yang sangat baik untuk pengembangan berbasis kontainer. Untuk bekerja dengan kontainer, buildah dan podman direkomendasikan.

Fedora Silverblue also comes with the toolbx utility, which uses containers to provide an environment where development tools and libraries can be installed and used.

Why use toolbx?

Toolbx makes it easy to use a containerized environment for everyday software development and debugging. On immutable operating systems, like Fedora Silverblue, it provides a familiar package-based environment in which tools and libraries can be installed and used. However, toolbx can also be used on package-based systems.

Using Toolbx for running your workflows in a containerized manner brings you several advantages:

  • Ini menjaga OS host tetap bersih dan stabil, dan membantu menghindari kekacauan yang dapat terjadi setelah menginstal banyak alat dan paket pengembangan.

  • Anda mendapatkan akses ke berbagai versi distribusi yang didukung, tidak tergantung pada versi yang Anda jalankan.

  • Kontainer adalah cara yang baik untuk mengisolasi dan mengatur ketergantungan yang diperlukan untuk berbagai proyek.

  • Kontainer adalah tempat yang aman untuk bereksperimen: jika terjadi kesalahan, Anda dapat dengan mudah membuang toolbox dan memulai lagi.

However, it is very important to note that toolbx containers are still integrated with your host system, so you should not attempt to do things or run software you otherwise wouldn’t on your host system. Toolbx containers are not completely isolated environments like virtual machines.

Bagaimana cara kerjanya

Toolbx takes the work out of using containers, by providing a small number of simple commands to create, enter, list and remove containers. It also integrates toolbx containers into your regular working environment, to make it easy for you to use them as an everyday development space.

Containers are created from images and those are usually a very stripped down version of distributions. In such images there are almost no tools and documentation available. The team behind Toolbx maintains a Fedora image where such tools and documentation are available, providing a good out of the box experience.

Each toolbx container is an environment that you can enter from the command line. Inside each one, you will find:

  • Nama pengguna dan hak akses Anda saat ini

  • Akses ke direktori home Anda dan beberapa lokasi lainnya

  • Akses ke sistem dan sesi D-Bus, jurnal sistem, dan Kerberos

  • Alat bantu baris perintah umum, termasuk manajer paket (mis., DNF di Fedora)

In other words, toolbx containers look, feel and behave like a standard Linux command line environment. By connecting all this information, toolbx containers lose a certain amount of security gained by using the containers technology. Therefore, you should not treat toolbx containers as a sandbox where you can execute any script you would never run on any other system.

In most cases, when a command is run inside a container, the program from inside the container is used. However, there are a few special cases where the program on the host is used instead (using flatpak-spawn). One example of this is the toolbox command itself; this makes it possible to use toolbx from inside toolbx containers.

Instalasi

Fedora Silverblue

Toolbx is preinstalled on Fedora Silverblue.

Fedora Workstation

Toolbx can be installed on Fedora Workstation (or any package-based version of Fedora) with the following command:

$ sudo dnf install toolbox

Toolbox pertama Anda

Once toolbx is installed, two simple commands are required to get started:

$ toolbox create

This will download an OCI image and create a toolbx container from it. Once this is complete, run:

$ toolbox enter

Setelah berada di dalam toolbox, Anda dapat mengakses alat baris perintah umum, dan menginstal alat baru menggunakan manajer paket (misalnya, DNF di Fedora).

When the prompt is inside a toolbox, it is prepended with a diamond: this indicates that the prompt is inside a toolbx container. The diamond symbol may not be present if you use a custom shell theme.

Perintah dan penggunaan

toolbox create [options] <name>

Creates a toolbx container. This will download an OCI image if one isn’t available (this is required to create the container). By default an image matching the version of the host is used. If the host system does not have a matching image, a Fedora image is used instead.

Jika digunakan tanpa opsi, toolbox create akan secara otomatis menamai kontainer yang dibuatnya. Untuk membuat toolbox tambahan, gunakan argumen <nama>.

Untuk menggunakan versi tertentu dari sistem host (misalnya, Fedora 32 pada Fedora 34), gunakan opsi --release <release> | -r <release>.

To use a different distribution to create a toolbx container (e.g., RHEL on Fedora), use the --distro <distro> | -d <distro> option.

Untuk menggunakan citra yang berbeda, gunakan opsi --image <name> | -i <name>.

toolbox enter [options] <name>

Masuk ke toolbox untuk penggunaan interaktif. Digunakan tanpa opsi, toolbox enter membuka kotak alat default.

Untuk memasuki toolbox dengan nama tertentu, gunakan argumen name.

Untuk masuk ke toolbox untuk distribusi yang berbeda (misalnya, Fedora pada RHEL), gunakan opsi --distro <distro> |-d <distro>.

Untuk masuk ke toolbox dengan versi tertentu (misal, RHEL 8.1 pada RHEL 8.3), gunakan opsi --release <release> | -r <release>.

toolbox run [options] <cmd> <arg …​>

Menjalankan perintah dalam toolbox tanpa memasukinya. Digunakan tanpa opsi, toolbox run menjalankan perintah dalam toolbox default.

Untuk menjalankan perintah dalam toolbox dengan nama tertentu, gunakan opsi --container <name> | -c <name>.

Untuk menjalankan perintah pada toolbox untuk distribusi yang berbeda (misalnya, Fedora pada RHEL), gunakan opsi --distro <distro> |-d <distro>.

Untuk menjalankan perintah pada toolbox dengan versi tertentu (misal: RHEL 8.1 pada RHEL 8.3), gunakan opsi --release <release> | -r <release>.

toolbox list [options]

Lists local toolbx images and containers.

Untuk hanya menampilkan kontainer, gunakan opsi --containers | -c.

Untuk hanya menampilkan citra, gunakan opsi --images | -i.

toolbox rm [options] <name …​>

Removes one or more toolbx containers.

Opsi --force | -f akan menghapus kontainer yang ditandai meskipun kontainer tersebut sedang berjalan.

The --all | -a option removes all toolbx containers.

toolbox rmi [options] <name …​>

Removes one or more toolbx images.

Opsi --force | -f menghapus citra yang ditandai dan semua kontainer yang telah dibuat menggunakan citra yang ditandai.

The --all | -a option removes all toolbx images.

toolbox --help

Shows Toolbx’s manual page.

Keluar dari toolbox

Untuk kembali ke lingkungan host, jalankan exit atau keluar dari shell saat ini (biasanya Ctrl+D).

Di bawah tenda

Toolbx uses the following technologies:

Kontak dan permasalahan

To report issues, make suggestions, or contribute fixes, see toolbx’s GitHub project.

To get in touch with toolbx users and developers, use Fedora’s Discourse instance, or join the #silverblue IRC channel on Libera.