Skip to content

1. How to install wsl2 podman

1.1 What is Podman ?

Podman is an alternative to Docker, 100% compatible with Docker Images, but without any daemon process or system service (see this as a center program which manages your containers for you) and also without the use of Systemd (which makes us use workaround to make Docker work in WSL).

1.2 How to install Podman ?

In order to install Podman, you'll need to install the following components first :

  • WSL (short for Windows Subsystem for Linux)
  • Oracle Linux 8.5 (in Powershell do wsl --install OracleLinux_8_5)

Once you've installed Oracle Linux (which is a fork of RedHat Linux), you'll have to update your local packages like this :

sudo dnf update

and then install Podman like this :

sudo dnf install podman

Once Podman is installed, you can directly pull Docker Images and launch them in containers, but for the ones on our Nexus, you'll have a few more steps to do.

1.3 How to configure Podman for 2MoRO's Docker Images ?

First, you'll need to go to /etc/containers/ and update registries.conf file (use vim or nano as you prefer).

In registries.conf, you'll have to modify the registries.insecure block with the following text :

[registries.insecure]
registries = ["nexus-ext.2moro.fr:8088"]

Then, you'll have to create a file similar to the config.json file created in wsl2-docker-install.md like this :

{
    "auths": {
        "nexus-ext.2moro.fr:8088": {
            "auth": "ZG9ja2VyOkFVTWQ3em1weXBRN0tTZkxpMHdVRA=="
        }
    }
}

And it's done.

1.4 How to use Docker Containers into Podman with 2MoRO's Images ?

If you need to build, pull, or push an image, it's nearly the same command lines than with Docker with only 2 differences :

  • You'll have to replace the keyword docker by podman.
  • You'll need to add an option in order to authentificate to Nexus (which is automatic on Docker thanks to the daemon process or system service and config.json file).

So, when you do the following with Docker (here, pushing an image to Docker) :

docker push nexus-ext.2moro.fr:8088/prepare-v7-delivery:latest

With Podman, your command line will look like this :

podman push nexus-ext.2moro.fr:8088/prepare-v7-delivery:latest --authfile=~/auth.json

1.5 For curious people

If you want to go further into Podman and expand your knowledge about this software, here are some articles made by Linux Handbook team (the same as It's FOSS, a website about Linux and Free and Open Source Software) about Podman, how to use it, and its differences with Docker :


Last update: 2024-02-15
Created: 2024-01-30