Monday, 4 October 2021

Podman - my first time

Now that things are a-changin' with Docker Desktop, I wanted to give podman a try.

I'm running macOS 11.6 Big Sur and have Homebrew installed: -

brew --version

Homebrew 3.2.14
Homebrew/homebrew-core (git revision 161852c41e5; last commit 2021-10-01)
Homebrew/homebrew-cask (git revision 486624192d; last commit 2021-10-01)

so simply installed podman via brew install podman.

Having installed, I checked the version of podman thusly: -

podman version

Client:
Version:      3.4.0
API Version:  3.4.0
Go Version:   go1.17.1
Built:        Thu Sep 30 19:44:31 2021
OS/Arch:      darwin/amd64
Server:
Version:      3.3.1
API Version:  3.3.1
Go Version:   go1.16.6
Built:        Mon Aug 30 21:46:36 2021
OS/Arch:      linux/amd64

Starting at the beginning, I tried ( and sadly failed ) to run the stock Hello World image: -

podman run hello-world

Resolved "hello-world" as an alias (/etc/containers/registries.conf.d/000-shortnames.conf)
Trying to pull docker.io/library/hello-world:latest...
Getting image source signatures
Copying blob sha256:2db29710123e3e53a794f2694094b9b4338aa9ee5c40b930cb8063a1be392c54
Copying blob sha256:2db29710123e3e53a794f2694094b9b4338aa9ee5c40b930cb8063a1be392c54
Copying config sha256:feb5d9fea6a5e9606aa995e879d862b825965ba48de054caab5ef356dc6b3412
Writing manifest to image destination
Storing signatures
Error: error preparing container f8dee00901c488f0362af2ffe6e8736a41a609890bfc2f3f8863349932cb050d for attach: error configuring network namespace for container f8dee00901c488f0362af2ffe6e8736a41a609890bfc2f3f8863349932cb050d: error adding pod confident_panini_confident_panini to CNI network "podman": unexpected end of JSON input

Thankfully, GitHub had the answer: -


which says in part: -

Should be fixed once podman 3.4 lands in CoreOS, as workaround you have to forward at least one port, e.g. -p 8080.

This is a duplicate of: -


which says, in part: -

TLDR, the bug is that you cannot use the machine plugin without ports.

Given this, I tried the circumvention ( even though Hello World doesn't actually need a port ) : -

podman run -p 8080:8080 hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

~ $ ERRO[170262] accept tcp [::]:8080: use of closed network connection 

Given the GitHub issues, and noting that the "server" side of Podman is still 3.3.1 : -

podman version

Client:
Version:      3.4.0
API Version:  3.4.0
Go Version:   go1.17.1
Built:        Thu Sep 30 19:44:31 2021
OS/Arch:      darwin/amd64

Server:
Version:      3.3.1
API Version:  3.3.1
Go Version:   go1.16.6
Built:        Mon Aug 30 21:46:36 2021
OS/Arch:      linux/amd64

I'll keep an eye on the issue etc. and see when we see a fix for the server side ....

2 comments:

Gini said...

did you find any solution for this ?

Dave Hay said...

Yep, all appears OK now: -

podman version


Client:
Version: 3.4.4
API Version: 3.4.4
Go Version: go1.17.3
Built: Wed Dec 8 18:41:11 2021
OS/Arch: darwin/amd64

Server:
Version: 3.4.1
API Version: 3.4.1
Go Version: go1.16.8
Built: Wed Oct 20 15:35:28 2021
OS/Arch: linux/amd64


podman run hello-world


Resolved "hello-world" as an alias (/etc/containers/registries.conf.d/000-shortnames.conf)
Trying to pull docker.io/library/hello-world:latest...
Getting image source signatures
Copying blob sha256:2db29710123e3e53a794f2694094b9b4338aa9ee5c40b930cb8063a1be392c54
Copying blob sha256:2db29710123e3e53a794f2694094b9b4338aa9ee5c40b930cb8063a1be392c54
Copying config sha256:feb5d9fea6a5e9606aa995e879d862b825965ba48de054caab5ef356dc6b3412
Writing manifest to image destination
Storing signatures

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/

For more examples and ideas, visit:
https://docs.docker.com/get-started/

Reminder - how to split strings in a shell script

There's almost certainly 73 different ways to do this, but this worked for me The problem to be solved ... I have a string containing th...