Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fedora - A quick introduction to Toolbox on Fedora

#1
A quick introduction to Toolbox on Fedora

<div><p>Toolbox allows you to <a href="https://docs.fedoraproject.org/en-US/fedora-silverblue/toolbox/">sort and manage your development environments in containers</a> without requiring root privileges or manually attaching volumes. It creates a container where you can install your own CLI tools, without installing them on the base system itself. You can also utilize it when you do not have root access or cannot install programs directly. This article gives you an introduction to toolbox and what it does.</p>
<p> <span id="more-29645"></span> </p>
<h2>Installing Toolbox</h2>
<p><a href="https://fedoramagazine.org/what-is-silverblue/">Silverblue</a> includes Toolbox by default. For the Workstation and Server editions, you can grab it from the default repositories using <em>dnf install toolbox</em>. </p>
<h2>Creating Toolboxes</h2>
<p>Open your terminal and run <em>toolbox enter</em>. The utility will automatically request permission to download the latest image, create your first container, and place your shell inside this container. </p>
<pre class="wp-block-preformatted">$ toolbox enter
No toolbox containers found. Create now? [y/N] y
Image required to create toolbox container.
Download registry.fedoraproject.org/f30/fedora-toolbox:30 (500MB)? [y/N]: y</pre>
<p>Currently there is no difference between the toolbox and your base system. Your filesystems and packages appear unchanged. Here is an example using a repository that contains documentation source for a resume under a <em>~/src/resume</em> folder. The resume is built using the <em>pandoc</em> tool.</p>
<pre class="wp-block-preformatted">$ pwd /home/rwaltr $ cd src/resume/ $ head -n 5 Makefile all: pdf html rtf text docx pdf: init pandoc -s -o BUILDS/resume.pdf markdown/* $ make pdf
bash: make: command not found
$ pandoc -v
bash: pandoc: command not found</pre>
<p>This toolbox does not have the programs required to build the resume. You can remedy this by installing the tools with <em>dnf</em>. You will not be prompted for the root password, because you are running in a container.</p>
<pre class="wp-block-preformatted">$ sudo dnf groupinstall "Authoring and Publishing" -y &amp;&amp; sudo dnf install pandoc make -y
... $ make all #Successful builds
mkdir -p BUILDS
pandoc -s -o BUILDS/resume.pdf markdown/*
pandoc -s -o BUILDS/resume.html markdown/*
pandoc -s -o BUILDS/resume.rtf markdown/*
pandoc -s -o BUILDS/resume.txt markdown/*
pandoc -s -o BUILDS/resume.docx markdown/*
$ ls BUILDS/
resume.docx resume.html resume.pdf resume.rtf resume.txt</pre>
<p>Run <em>exit</em> at any time to exit the toolbox.</p>
<pre class="wp-block-preformatted">$ cd BUILDS/
$ pandoc --version || ls
pandoc 2.2.1
Compiled with pandoc-types 1.17.5.4, texmath 0.11.1.2, skylighting 0.7.5
...
for a particular purpose.
resume.docx resume.html resume.pdf resume.rtf resume.txt
$ exit logout
$ pandoc --version || ls
bash: pandoc: command not found...
resume.docx resume.html resume.pdf resume.rtf resume.txt</pre>
<p>You retain the files created by your toolbox in your home directory. None of the programs installed in your toolbox will be available outside of it.</p>
<h2>Tips and tricks</h2>
<p>This introduction to toolbox only scratches the surface. Here are some additional tips, but you can also check out <a href="https://docs.fedoraproject.org/en-US/fedora-silverblue/toolbox/">the official documentation</a>.</p>
<ul>
<li><em>Toolbox –help</em> will show you the man page for Toolbox</li>
<li>You can have multiple toolboxes at once. Use <em>toolbox create -c Toolboxname</em> and <em>toolbox enter -c Toolboxname</em></li>
<li>Toolbox uses <a href="https://podman.io/">Podman</a> to do the heavy lifting. Use <em>toolbox list</em> to find the IDs of the containers Toolbox creates. Podman can use these IDs to perform actions such as <em>rm</em> and <em>stop</em>. (You can also read more about Podman <a href="https://fedoramagazine.org/running-containers-with-podman/">in this Magazine article</a>.)</li>
</ul>
<hr class="wp-block-separator" />
<p><em>Photo courtesy of <a href="https://flickr.com/photos/florianric/">Florian Richter</a> from <a href="https://flickr.com/photos/florianric/7263382550/">Flickr</a>.</em></p>
</div>


https://www.sickgaming.net/blog/2019/11/...on-fedora/
Reply



Forum Jump:


Users browsing this thread:
2 Guest(s)

Forum software by © MyBB Theme © iAndrew 2016