Migrating from Docker to Podman

Migrating from Docker to Podman enables a daemonless, rootless container management approach, improving security and compatibility with RHEL 8+. The migration process includes verifying system compatibility, transferring container images and volumes, updating scripts, and ensuring smooth operation with BigFix MCM and BigFix Mobile.

Prerequisite

  • Ensure you have RHEL 8 or above.
    Note: RHEL 7 reached the end of its maintenance support. For detailed instructions to upgrade, refer to RHEL official documentation.
  • Ensure that the volumes in /var/opt/BESUEM and /opt/BESUEM are preserved and not removed.
  • If you have already upgraded to the latest version of MCM without migrating from Docker to Podman, then you have to wait until the next MCM release for the upgrade Fixlet to be applicable to completely migrate from Docker to Podman.

Step 1. Remove Docker

Remove Docker using the following commands:

docker rm -f $(docker ps -a -q);docker rmi -f $(docker images -q);docker volume rm besuem_certs;docker volume rm besuem_packages
sudo systemctl stop docker.socket
sudo systemctl stop docker
sudo yum remove docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras
rm /usr/local/bin/docker-compose

Step 2. Set up Podman

  1. Install Podman
    sudo dnf install -y podman
  2. Check Podman version
    podman --version
    Displays the installed version of Podman. Ensures Podman is installed and available on the system.
  3. Check Python version and upgrade if necessary
    python3 --version
    • Displays the installed version of Python 3.

    • If Python 3.9+ is installed, proceed to the next step. Otherwise, upgrade from an older version (For example, 3.6 → 3.9).

  4. Install pip (Python Package Manager)
    sudo dnf install -y python3-pip
    • Installs pip3, the package manager for Python, using dnf (the package manager for RHEL-based systems).
    • The -y flag automatically confirms the installation.
  5. Verify pip installation
    pip3 --version
    Displays the installed version of pip3, ensuring it's installed and functional.
  6. Install Podman Compose using pip
    pip3 install podman-compose
    Installs Podman Compose, allowing users to manage multiple Podman containers using a docker-compose.yml file.
  7. Verify Podman Compose installation
    ls /usr/local/bin/podman-compose
    Checks if podman-compose is present in /usr/local/bin/, which is a common location for executables installed via pip.
  8. Create a Symlink for Podman
    ln -s /usr/bin/podman /usr/local/bin/podman
    Ensures podman is accessible in /usr/local/bin/ by linking it to /usr/bin/podman.
  9. Create a Symlink for Podman Compose
    ln -s /usr/local/bin/podman-compose /usr/bin/podman-compose
    Creates a symbolic link (ln -s) so that podman-compose can be executed from /usr/bin/, making it accessible system-wide.
  10. Verify Podman Compose again
    podman-compose --version
    Confirms that podman-compose is correctly installed and available after the symlink.
  11. Verify if Podman is installed and executable
    podman ps and podman images
  12. Upgrade MCM to the latest version through WebUI.
  13. Verify if Podman containers are running as expected
    podman ps
    Ddisplays all currently running Podman containers.
  14. Verify if Podman images are downloaded
    podman images

    Shows all locally available container images, including their repository names, tags, and sizes.