Install Podman

I am not going to focus too much on the installation because official documents would definitely be better than my blog. For my blog, I would like to focus more on things that are not covered in the documents and my experiences. You can follow run podman on windows machine to install podman. This post is super detailed on how you should do. Before installing podman, please remember to install WSL first. Microsoft has an install manual on it.
After you install Podman, run command podman run quay.io/podman/hello and you should have an output like this:
image.png

Trials

Below was my experiences with container and podman and that is basically why I chose to use podman rather than Docker Desktop.
My work at Silicon Labs required me to put my project into a pipeline in Jenkins. So I implemented Jenkins locally on a Windows 10 machine. However, the Jenkinsfile is different for Linux and Windows machines and Linux has a more complex shell which turned out to be useful to the project.

First attempt

My first attempt was to install WSL which is necessary. I tried to install Jenkins in WSL and ran it locally. However, there are some issue with VPN setting for WSL2. So, when I work from home, Jenkins needs VPN to connect to the company’s bitbucket and Jenkins in WSL cannot do that.

Then I tried to connect WSL as a working node for pipeline, but stuck at the credential configuration things. I don’t know why but the ssh connection is so bad and I could not even connect to the host.

It took me a whole day working on this and had nothing. I gave in at last, adapting Jenkinsfile and commands and project to Powershell.

Second round

The next day, I asked my colleague how to tackle this situation. He said it might take time to give an access to a Jenkins server and suggested me to run containers locally as a working node and it was also how they did for the pipelines. I did read a few articles describing that work but I never thought about that because I once installed Docker Desktop on my old laptop and it sucks. Joe also didn’t recommand Docker because company needs licence (which we don’t have one) to use Docker Desktop.

He recommanded Podman, a good replacement for Docker. And he also sent me a link on swarm to connect to Jenkins. I worked on this practice for the afternoon and it worked! And with the power of Bash, I greatly simplified the Jenkinsfile.

Troubleshooting

Though I have successfully installed podman, there are a lot of troubles when I tried to use it. Here are some troubles and my workaroud.

WSL is not installed

Sometimes I tried to start podman but failed. It said WSL is not installed. I don’t know why because it happens occasionally. My guess is that it is because of some updates. Just reinstalled it and it won’t take a long time.

Can ping but cannot curl

As I said previously, I was intended to connect to a container with Jenkins. When I ran a swarm client in a container and tried to connect to the server in Jenkins on the host machine, it failed. More tricky is that it can pingbut cant curl. That is tricky, but also a great breakthrough because it means that the host is not unreachable and it might be some security rules blocking it.
Though it is a painful to try out all the possible solutions to this problem, I found a solution. In this issue in WSL, there are a lot of nice ways to fix the network, which proved my previous guessing.