<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Docker on iMil.net</title>
    <link>http://imil.net/blog/tags/docker/</link>
    <description>Recent content in Docker on iMil.net</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 23 Oct 2023 11:46:31 +0200</lastBuildDate>
    <atom:link href="http://imil.net/blog/tags/docker/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>NetBSD as a Kubernetes Pod</title>
      <link>http://imil.net/blog/posts/2023/netbsd-as-a-k8s-pod/</link>
      <pubDate>Mon, 23 Oct 2023 11:46:31 +0200</pubDate>
      <guid>http://imil.net/blog/posts/2023/netbsd-as-a-k8s-pod/</guid>
      <description>&lt;p&gt;&lt;strong&gt;2025/01 Update&lt;/strong&gt; &lt;a href=&#34;https://github.com/NetBSDfr/smolBSD/tree/main/k8s&#34;&gt;https://github.com/NetBSDfr/smolBSD/tree/main/k8s&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;I had to do it.&lt;br&gt;&#xA;So here&amp;rsquo;s how to run a &lt;em&gt;NetBSD&lt;/em&gt; micro-vm as&amp;hellip; a &lt;em&gt;Kubernetes&lt;/em&gt; pod.&lt;/p&gt;&#xA;&lt;p&gt;First thing is to modify the &lt;a href=&#34;https://imil.net/blog/posts/2023/netbsd-as-a-docker-container/&#34;&gt;start script from the previous article&lt;/a&gt; in order to add &lt;em&gt;Docker&lt;/em&gt;-style networking, i.e. port forwarding from the host to the micro-vm. This is done using the &lt;code&gt;hostfwd&lt;/code&gt; flag in &lt;em&gt;qemu&lt;/em&gt;&amp;rsquo;s &lt;code&gt;-netdev&lt;/code&gt; parameter&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;#!/bin/sh&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;kernel&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;$1&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;img&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;2&lt;span style=&#34;color:#66d9ef&#34;&gt;:-&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;root.img&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt; -n &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$3&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; drive2&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;-drive file=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;3&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;,if=virtio&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;qemu-system-x86_64 -enable-kvm -m &lt;span style=&#34;color:#ae81ff&#34;&gt;256&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;        -kernel $kernel -append &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;console=com root=ld0a&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;        -serial mon:stdio -display none &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;        -drive file&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;img&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;,if&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;virtio $drive2 &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;        -netdev user,id&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;net0,hostfwd&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;tcp::8080-:80 -device virtio-net,netdev&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;net0&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href=&#34;https://imil.net/blog/posts/2023/netbsd-as-a-docker-container/&#34;&gt;In the previous experience&lt;/a&gt; we mapped the kernel and the root image from the host using &lt;em&gt;Docker&lt;/em&gt;&amp;rsquo;s &lt;code&gt;-v&lt;/code&gt; parameter, and while it&amp;rsquo;s possible to map files from the host using a &lt;em&gt;Kubernetes&lt;/em&gt; &lt;code&gt;volume&lt;/code&gt;, we will bundle &lt;em&gt;NetBSD&lt;/em&gt; these files into the &lt;em&gt;Docker&lt;/em&gt;  image to make things easier.&lt;br&gt;&#xA;Please refer to &lt;a href=&#34;https://gitlab.com/iMil/mksmolnb#example-of-an-image-used-to-create-an-nginx-microvm-with-sailor&#34;&gt;mksmolnb&lt;/a&gt; documentation to learn how to produce a minimal &lt;code&gt;nginx&lt;/code&gt; micro-vm.&lt;/p&gt;</description>
    </item>
    <item>
      <title>NetBSD as a Docker Container</title>
      <link>http://imil.net/blog/posts/2023/netbsd-as-a-docker-container/</link>
      <pubDate>Fri, 20 Oct 2023 08:27:47 +0200</pubDate>
      <guid>http://imil.net/blog/posts/2023/netbsd-as-a-docker-container/</guid>
      <description>&lt;p&gt;I have &lt;a href=&#34;https://gitlab.com/iMil/mksmolnb&#34;&gt;this little toy project&lt;/a&gt; for quite a while now, and I have this idea of handling a fleet of &lt;em&gt;NetBSD&lt;/em&gt; micro-vms with &lt;em&gt;Kubernetes&lt;/em&gt; since I started my new job in which I am caring a &lt;em&gt;k8s&lt;/em&gt; cluster.&lt;/p&gt;&#xA;&lt;p&gt;I came to realize that starting a &lt;em&gt;smolBSD&lt;/em&gt; micro-vm with &lt;em&gt;Docker&lt;/em&gt; was not so difficult after all. Using &lt;code&gt;mksmolnb&lt;/code&gt;&amp;rsquo;s &lt;a href=&#34;https://gitlab.com/iMil/mksmolnb/-/blob/main/startnb.sh?ref_type=heads&#34;&gt;startnb.sh&lt;/a&gt; I came up with this very simple &lt;code&gt;Dockerfile&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-dockerfile&#34; data-lang=&#34;dockerfile&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;FROM&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;alpine:latest&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;RUN&lt;/span&gt; apk add --quiet --no-cache qemu-system-x86_64 iproute2 bridge-utils&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;COPY&lt;/span&gt; startnb.sh ./&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;COPY&lt;/span&gt; qemu/qemu-ifup qemu/qemu-ifdown /etc/&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;CMD&lt;/span&gt; /startnb.sh /netbsd-SMOL &lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;IMG&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;DISK&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;qemu-ifup&lt;/code&gt; being a simple copy of Debian&amp;rsquo;s &lt;code&gt;/etc/qemu-ifup&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Testing GPG Keys With Docker... and fail</title>
      <link>http://imil.net/blog/posts/2020/testing-gpg-keys-with-docker/</link>
      <pubDate>Wed, 10 Jun 2020 05:36:04 +0200</pubDate>
      <guid>http://imil.net/blog/posts/2020/testing-gpg-keys-with-docker/</guid>
      <description>&lt;p&gt;As a &lt;a href=&#34;https://www.passwordstore.org/&#34;&gt;password-store&lt;/a&gt; user, &lt;a href=&#34;https://gnupg.org/&#34;&gt;GPG&lt;/a&gt; is particularly important and sensitive, I use it for&#xA;pretty much everything authentication / encryption related. Also, about a year ago I got myself&#xA;a pair of &lt;a href=&#34;https://www.yubico.com/products/&#34;&gt;Yubikeys&lt;/a&gt;, and they are now involved in &lt;strong&gt;all&lt;/strong&gt; of the mentioned workflows.&lt;/p&gt;&#xA;&lt;p&gt;Now on the topic, as my keys are a crucial part of my online life, I wanted to make sure I had&#xA;those backuped safely, and moreover, that this backup is usable in an empty environment by simply importing the public and private keys. Among the various possibilities, I thought firing up a basic &lt;a href=&#34;https://www.docker.com/&#34;&gt;docker&lt;/a&gt; container with an interactive shell would be my fastest bet. How wrong I was.&lt;/p&gt;</description>
    </item>
    <item>
      <title>From GitLab CI to Docker Hub</title>
      <link>http://imil.net/blog/posts/2018/from-gitlab-ci-to-docker-hub/</link>
      <pubDate>Sun, 04 Nov 2018 09:24:59 +0000</pubDate>
      <guid>http://imil.net/blog/posts/2018/from-gitlab-ci-to-docker-hub/</guid>
      <description>&lt;p&gt;With all the noise around those topics I would have imagined this one had been covered thousands of time, yet I did not find a single complete resource on this subject which I found to be a basic building block: pushing docker images from &lt;a href=&#34;https://about.gitlab.com/product/continuous-integration/&#34;&gt;GitLab CI&lt;/a&gt; to the &lt;a href=&#34;https://hub.docker.com/&#34;&gt;Docker Hub registry&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;There&amp;rsquo;s actually an opened issue on &lt;a href=&#34;https://github.com/docker/hub-feedback/issues/334&#34;&gt;Docker GitHub&lt;/a&gt;&amp;rsquo;s that&amp;rsquo;s sitting there for 3 years, and it really feels more like a political / strategic / commercial issue than a technical one. Point being, there&amp;rsquo;s no straightforward integration between &lt;em&gt;GitLab.com&lt;/em&gt; and &lt;em&gt;Docker Hub&lt;/em&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Run CoreOS on FreeBSD&#39;s bhyve</title>
      <link>http://imil.net/blog/posts/2016/coreos_on_bhyve/</link>
      <pubDate>Tue, 21 Jun 2016 21:00:17 +0000</pubDate>
      <guid>http://imil.net/blog/posts/2016/coreos_on_bhyve/</guid>
      <description>&lt;p&gt;No, I&amp;rsquo;m not following the hype, only I like to test things plus I feel there will be a growing demand for &lt;a href=&#34;https://www.docker.com/&#34;&gt;docker&lt;/a&gt; at &lt;em&gt;${DAYWORK}&lt;/em&gt;. I read here and there that &lt;a href=&#34;https://coreos.com/&#34;&gt;CoreOS&lt;/a&gt; was the Linux distribution of choice to play with &lt;a href=&#34;https://www.docker.com/&#34;&gt;docker&lt;/a&gt;, so  while at it, I picked up this one to dive into the container world.&#xA;Finally, I&amp;rsquo;ve been willing to put my hands on &lt;a href=&#34;http://bhyve.org/&#34;&gt;bhyve&lt;/a&gt; for quite a while, so I took this opportunity to learn all those new (to me) technologies at once.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
