mirror of
https://github.com/davegallant/davegallant.github.io.git
synced 2025-08-14 12:20:19 +00:00
deploy: bf1706f84561a75a7e121ce35efb2764b9846928
This commit is contained in:
@@ -145,7 +145,7 @@ personal blog
|
||||
<time class=entry-date datetime=2021-10-11T10:43:35-04:00>2021, Oct 11</time>
|
||||
</span>
|
||||
<span class=reading-time><svg class="icon" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" aria-hidden="true"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 15 15"/></svg>
|
||||
4 mins read
|
||||
5 mins read
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -170,7 +170,8 @@ personal blog
|
||||
<div class=highlight><pre tabindex=0 style=background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-sh data-lang=sh><span style=color:#09f;font-style:italic># This is not necessary on Linux</span>
|
||||
podman machine init
|
||||
podman machine start
|
||||
</code></pre></div><p>Let’s try to pull an image:</p>
|
||||
</code></pre></div><h3 id=running-a-container>Running a container</h3>
|
||||
<p>Let’s try to pull an image:</p>
|
||||
<pre tabindex=0><code class=language-console data-lang=console>$ podman pull alpine
|
||||
Trying to pull docker.io/library/alpine:latest...
|
||||
Getting image source signatures
|
||||
@@ -182,20 +183,20 @@ Storing signatures
|
||||
</code></pre><blockquote>
|
||||
<p>If you’re having an issue pulling images, you may need to remove <code>~/.docker/config.json</code> or remove the set of auths in the configuration as mentioned <a href=https://stackoverflow.com/a/69121873/1191286>here</a>.</p>
|
||||
</blockquote>
|
||||
<p>and then exec into the container:</p>
|
||||
<p>and then run and exec into a container:</p>
|
||||
<pre tabindex=0><code class=language-console data-lang=console>$ podman run --rm -ti alpine
|
||||
Error: error preparing container 99ace1ef8a78118e178372d91fd182e8166c399fbebe0f676af59fbf32ce205b for attach: error configuring network namespace for container 99ace1ef8a78118e178372d91fd182e8166c399fbebe0f676af59fbf32ce205b: error adding pod unruffled_bohr_unruffled_bohr to CNI network "podman": unexpected end of JSON input
|
||||
</code></pre><p>What does this error mean? A bit of searching lead to <a href=https://github.com/containers/podman/issues/11837>this github issue</a>.</p>
|
||||
<p>Until the fix is released, a workaround is to just specify a port (even when it’s not needed):</p>
|
||||
<div class=highlight><pre tabindex=0 style=background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-sh data-lang=sh>podman run -p <span style=color:#f60>4242</span> --rm -ti alpine
|
||||
</code></pre></div><p>If you’re reading this from the future, there is a good chance specifying a port won’t be needed.</p>
|
||||
<p>Documentation such as <a href=https://jellyfin.org/docs/general/administration/installing.html#podman>Jellyfin’s</a> even include steps for podman.</p>
|
||||
<h3 id=aliasing-docker-with-podman>Aliasing docker with podman</h3>
|
||||
<p>Force of habit (or other scripts) may have you calling <code>docker</code>. To work around this:</p>
|
||||
<div class=highlight><pre tabindex=0 style=background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-sh data-lang=sh><span style=color:#366>alias</span> <span style=color:#033>docker</span><span style=color:#555>=</span>podman
|
||||
</code></pre></div><h3 id=podman-compose>podman-compose</h3>
|
||||
<p>You may be wondering: what about docker-compose? Well, there happens to be a drop-in replacement for it: <a href=https://github.com/containers/podman-compose>podman-compose</a>.</p>
|
||||
<p>You may be wondering: what about docker-compose? Well, there <em>claims</em> to be a drop-in replacement for it: <a href=https://github.com/containers/podman-compose>podman-compose</a>.</p>
|
||||
<div class=highlight><pre tabindex=0 style=background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-sh data-lang=sh>pip3 install --user podman-compose
|
||||
<span style=color:#366>alias</span> docker-compose<span style=color:#555>=</span>podman-compose
|
||||
</code></pre></div><p>Now let’s create a <code>docker-compose.yml</code> file to test:</p>
|
||||
<div class=highlight><pre tabindex=0 style=background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-sh data-lang=sh>cat <span style=color:#c30><< EOF >> docker-compose.yml
|
||||
</span><span style=color:#c30>version: '2'
|
||||
@@ -205,7 +206,7 @@ Error: error preparing container 99ace1ef8a78118e178372d91fd182e8166c399fbebe0f6
|
||||
</span><span style=color:#c30> command: [/bin/echo, 'Hello world']
|
||||
</span><span style=color:#c30>EOF</span>
|
||||
</code></pre></div><p>Now run:</p>
|
||||
<pre tabindex=0><code class=language-console data-lang=console>$ docker-compose up
|
||||
<pre tabindex=0><code class=language-console data-lang=console>$ podman-compose up
|
||||
podman pod create --name=davegallant.github.io --share net
|
||||
40d61dc6e95216c07d2b21cea6dcb30205bfcaf1260501fe652f05bddf7e595e
|
||||
0
|
||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user