Install of Portainer with Podman instead of Docker on OpenSUSE
Portainer can be configured to use Podman instead of Docker. Assumed that I have already get podman and cockpit-podman manage on cockpit.
First Method: Portainer with Podman on OpenSUSE host system
- Install Podman: Install Podman on your system if it is not already installed by running the following command:sudo zypper install podman
- Install Portainer: Install Portainer by running the following command:sudo zypper install portainer
- Edit the Portainer Configuration File sudo nano /etc/portainer/config.yml: Edit the Portainer configuration file to tell Portainer to use Podman instead of Docker. You can do this by adding the following lines to the file: defaultEngine: 'podman' podmanExecutable: '/usr/bin/podman'
- Restart Portainer: Restart the Portainer service by running the following command: systemctl restart portainer
- Access Portainer: Access Portainer by opening a web browser and going to the following URL: http://localhost:9000
Second Method: Portainer on Podman Container
This is a second method for running Portainer on your system. Instead of installing Portainer directly on your system, this command launches Portainer in a Podman container, which is a more isolated environment that can be easier to manage and remove.
Commands:- Runs Portainer in a Podman Container: The podman run command launches a Podman container with the name "portainer", based on the Docker image "docker.io/portainer/portainer-ce:latest".
- Run Portainer in the Background: The -d option runs the container in the background, which allows you to continue using the command line while the container is running.
- Ports: The -p 8000:8000 and -p 9443:9443 options map the container's ports to the host system's ports, which allows you to access Portainer from your web browser.
- Privileged Mode: The --privileged option gives the container full access to the host system's resources, which is required for Portainer to manage Podman containers.
- Podman Socket: The -v /run/podman/podman.sock:/var/run/docker.sock:z option mounts the Podman socket file to the container, which allows Portainer to communicate with Podman.
- Data Volume: The -v portainer:/data option creates a data volume called "portainer" and maps it to the container's /data directory. This is where Portainer stores its configuration and logs.
- Restart Policy: The --restart=always option tells Podman to restart the container if it stops, which ensures that Portainer is always running.
- Image Name: The docker.io/portainer/portainer-ce:latest image name is the official Portainer Community Edition image.
- podman run -d -p 8000:8000 -p 9443:9443 --privileged --name portainer --restart=always -v /run/podman/podman.sock:/var/run/docker.sock:z -v portainer:/data docker.io/portainer/portainer-ce:latest
- http://localhost:9443, or
- http://localhost:9000
By the way, this means that you'll be able to manage your Podman containers directly from Cockpit as well as from Portainer, which can be convenient for managing your system.
Comments
Post a Comment