TinyComputers.io (Posts about quartz64)https://tinycomputers.io/categories/quartz64.atom2024-03-29T01:50:39ZA.C. JokelaNikolaPine64 Quartz64 A - Running Dockerhttps://tinycomputers.io/posts/pine64-quartz64-a-running-docker.html2022-12-12T17:40:49-06:002022-12-12T17:40:49-06:00A.C. Jokela<h3>Getting Started</h3>
<p>Getting <a href="https://www.docker.com/">docker</a> installed and running on a Pine64 Quartz64 A is relatively straightforward once you have found a disk image that has a few necessary things. We have a number of artisan-crafted operating systems. Most are Debian/Ubuntu feeling; there is <a href="https://dietpi.com/">DietPi</a> which has a very nice look and feel - minimalist creation. There is also <a href="https://github.com/Plebian-Linux/quartz64-images">Plebian Linux</a>, which is maintained by <a href="https://github.com/CounterPillow">CounterPillow</a>. It is very bleeding edge for its development stage. It feels less like a Linux system and more like a quirky <a href="https://www.netbsd.org">NetBSD</a> system. But, will not be using either of those; we will be using <a href="https://armbian.org">Armbian</a>. There are community maintained disk images but there is one problem: as of the time this post has been written, Dec 12, 2022, the images available from Armbian on Github do not have functioning ethernet. There is a paragraph or so on Pine64's <a href="https://wiki.pine64.org/wiki/Quartz64#No_Ethernet_Connectivity">wiki</a> about network connectivity, but I am not certain if the issue I am experiencing is related to that or if it is just a red herring.</p>
<p>Even though DietPi and Plebian have that familiar Debian/Ubuntu smell, each has its own issue that makes us drive toward Armbian. </p>
<p>First, DietPi. I love the minimalist feel but attempting to run <code>sudo apt install docker-ce</code>results in <code>dpkg</code> failing for some unclear reason. I really wanted something that should easily follow instructions that are found just about anywhere on internet for installing Docker on a Debian/Ubuntu system -- I did not want to take time trying to figure what was causing this error.</p>
<p>Second, Plebian. Plebian feels like NetBSD from early 2000s. It's rough around the edges and according its maintainer, should not be used in any capacity other than trying to help develop the distribution. The main issue that I found is it is based upon <a href="https://www.debian.org/doc/manuals/debian-faq/ftparchives#testing">Debian bookworm</a>, also known as <em>testing</em>. Docker does not have readily available Debian packages for bookworm. Bookworm is too new. I could have taken the time to figure out how to handcraft an install, but that is not what I am looking to do.</p>
<p>If you dig deep enough into the world of niche internet forums related to Pine64, Quartz64 or single board computers, you may find your way to <a href="https://forum.armbian.com/topic/23054-quartz64-model-a-installation-help/">Quartz64 Model A installation help</a> --> brings you to <a href="https://forum.pine64.org/showthread.php?tid=16312">this forum post</a> on Armbian's main forum site. Scroll down, and you find another link, this time to use <a href="https://users.armbian.com/balbes150/quartz64/">balbes150's Armbian's file storage</a> (<a href="https://ajokela.github.io/aws-s3-bucket-browser/index.html?bucket=https://s3.us-east-1.amazonaws.com/cdn.tinycomputers.io/index.html#balbes150/">mirror</a>).</p>
<p>I selected a <a href="https://users.armbian.com/balbes150/quartz64/Armbian_22.11.0-trunk_Quartz64a_jammy_edge_6.1.0.img.xz">Jammy distribution image</a>. Why? Because Docker has packages readily available for Jammy.</p>
<h3>Write a Disk Image</h3>
<p>There are literally thousands of examples of how to write a disk image to an SD card or eMMC module; everyone's setup maybe a different from others. If you are GUI-inclined, I would recommend <a href="https://www.balena.io/etcher/">balena Etcher</a>. One of the only issues I can see if it will not run on Arm-based computers, it is only available for x86|64.</p>
<p>If you are more command line inclined, you can use the program <code>dd</code>. <a href="https://www.linuxandubuntu.com/home/how-to-burn-iso-image-to-dvd-and-usb-using-dd">Here is one</a> that is fairly indepth look at using <code>dd</code>. If you are impatient and know what the name is of your device, something like the following:</p>
<div class="code"><pre class="code literal-block">xzcat Armbian-Quartz64-jammy-edge.img.xz | dd of=/dev/mmcblk1 status=progress
</pre></div>
<p>This assumes many things, but as a skilled and sophisticated Linux/UNIX user, you should not have any issues writing an image to a media type.</p>
<h3><img alt="dd-writing-image-to-media" src="https://tinycomputers.io/images/dd-writing-image-to-media.png.webp"></h3>
<h3>Installing Docker</h3>
<p>The following is a summarization of <a href="https://docs.docker.com/engine/install/ubuntu/">Install Docker Engine on Ubuntu</a>.</p>
<h4>Cleanup Old Versions</h4>
<p>Previous versions of <code>docker</code> were called a few things; let's remove the cruft.</p>
<div class="code"><pre class="code literal-block">$<span class="w"> </span>sudo<span class="w"> </span>apt-get<span class="w"> </span>remove<span class="w"> </span>docker<span class="w"> </span>docker-engine<span class="w"> </span>docker.io<span class="w"> </span>containerd<span class="w"> </span>runc
</pre></div>
<p>With those things removed, we will move onto setting a few things up to use Docker's package repository.</p>
<div class="code"><pre class="code literal-block"><span class="w"> </span>$<span class="w"> </span>sudo<span class="w"> </span>apt-get<span class="w"> </span>update
<span class="w"> </span>$<span class="w"> </span>sudo<span class="w"> </span>apt-get<span class="w"> </span>install<span class="w"> </span><span class="se">\</span>
<span class="w"> </span>ca-certificates<span class="w"> </span><span class="se">\</span>
<span class="w"> </span>curl<span class="w"> </span><span class="se">\</span>
<span class="w"> </span>gnupg<span class="w"> </span><span class="se">\</span>
<span class="w"> </span>lsb-release
</pre></div>
<p>Add Docker's GPG key (this makes it so you are less likely to get a compromised docker patch from Docker):</p>
<div class="code"><pre class="code literal-block"><span class="w"> </span>$<span class="w"> </span>sudo<span class="w"> </span>mkdir<span class="w"> </span>-p<span class="w"> </span>/etc/apt/keyrings
<span class="w"> </span>$<span class="w"> </span>curl<span class="w"> </span>-fsSL<span class="w"> </span>https://download.docker.com/linux/ubuntu/gpg<span class="w"> </span><span class="p">|</span><span class="w"> </span>sudo<span class="w"> </span>gpg<span class="w"> </span>--dearmor<span class="w"> </span>-o<span class="w"> </span><span class="se">\</span>
<span class="w"> </span>/etc/apt/keyrings/docker.gpg
</pre></div>
<p>Setup the repository:</p>
<div class="code"><pre class="code literal-block"><span class="nb">echo</span><span class="w"> </span><span class="se">\</span>
<span class="w"> </span><span class="s2">"deb [arch=</span><span class="k">$(</span>dpkg<span class="w"> </span>--print-architecture<span class="k">)</span><span class="s2"> signed-by=/etc/apt/keyrings/docker.gpg] \ </span>
<span class="s2"> https://download.docker.com/linux/ubuntu \</span>
<span class="s2"> </span><span class="k">$(</span>lsb_release<span class="w"> </span>-cs<span class="k">)</span><span class="s2"> stable"</span><span class="w"> </span><span class="p">|</span><span class="w"> </span>sudo<span class="w"> </span>tee<span class="w"> </span>/etc/apt/sources.list.d/docker.list<span class="w"> </span>><span class="w"> </span>/dev/null
</pre></div>
<p>This settings things up for us to be able to pull down officials packages from Docker. Let's refresh our available packages and install Docker.</p>
<div class="code"><pre class="code literal-block">$<span class="w"> </span>sudo<span class="w"> </span>apt-get<span class="w"> </span>update
$<span class="w"> </span>sudo<span class="w"> </span>apt-get<span class="w"> </span>install<span class="w"> </span>docker-ce<span class="w"> </span>docker-ce-cli<span class="w"> </span>containerd.io<span class="w"> </span>docker-compose-plugin
</pre></div>
<p>Docker should be running; let's test it.</p>
<div class="code"><pre class="code literal-block">$<span class="w"> </span>sudo<span class="w"> </span>docker<span class="w"> </span>run<span class="w"> </span>hello-world
</pre></div>
<p><img alt="success!" src="https://tinycomputers.io/images/pine64-quartz64-A-docker-2022-12-12%2017-28-15.png.webp"></p>