<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Containers on blog.jan0ski.net</title><link>/tags/containers/</link><description>Recent content in Containers on blog.jan0ski.net</description><generator>Hugo</generator><language>en-us</language><managingEditor>mccormickt9@gmail.com (Tommy McCormick)</managingEditor><webMaster>mccormickt9@gmail.com (Tommy McCormick)</webMaster><copyright>© Tommy McCormick</copyright><lastBuildDate>Fri, 29 Jan 2021 22:10:24 -0500</lastBuildDate><atom:link href="/tags/containers/index.xml" rel="self" type="application/rss+xml"/><item><title>HostPath</title><link>/post/hostpath/</link><pubDate>Fri, 29 Jan 2021 22:10:24 -0500</pubDate><author>mccormickt9@gmail.com (Tommy McCormick)</author><guid>/post/hostpath/</guid><description>&lt;h2 id="mounting-root-volumes-inside-containers"&gt;Mounting Root Volumes Inside Containers&lt;/h2&gt;&#10;&lt;h3 id="docker"&gt;Docker&lt;/h3&gt;&#10;&lt;p&gt;Run an alpine container with root filesystem mounted under &lt;code&gt;/host&lt;/code&gt; in the container&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;$ docker run --rm -it -v /:/host alpine:latest /bin/sh&#10;$ / # cat /etc/os-release&#10;NAME=&amp;#34;Alpine Linux&amp;#34;&#10;ID=alpine&#10;VERSION_ID=3.12.0&#10;PRETTY_NAME=&amp;#34;Alpine Linux v3.12&amp;#34;&#10;HOME_URL=&amp;#34;https://alpinelinux.org/&amp;#34;&#10;BUG_REPORT_URL=&amp;#34;https://bugs.alpinelinux.org/&amp;#34;&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Changing my root directory to the &lt;code&gt;/host&lt;/code&gt; directory with &lt;code&gt;chroot&lt;/code&gt; allows us to break out of the container.&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;/ # ls&#10;bin etc host media opt root sbin sys usr&#10;dev home lib mnt proc run srv tmp var&#10;&#10;/ # chroot /host bash&#10;groups: cannot find name for group ID 11&#10;To run a command as administrator (user &amp;#34;root&amp;#34;), use &amp;#34;sudo &amp;lt;command&amp;gt;&amp;#34;.&#10;See &amp;#34;man sudo_root&amp;#34; for details.&#10;root@3396f9188944:/#&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Show release information has changed to Ubuntu (WSL)&lt;/p&gt;</description></item></channel></rss>