Replacing docker socket with podman sockets

I'm using traefik and want to use podman sockets over docker sockets, which when done i can't access port 8080 over the internet.

CODE BASE

Ubuntu Version : 24.04
Podman Version : 4.9.3

services:

  reverse-proxy:
    # The official v3 Traefik docker image
    image: traefik:v3.3
    # Enables the web UI and tells Traefik to listen to docker
    command:
      - --api.insecure=true
      - --providers.docker
      - --log.level=DEBUG
    ports:
      # The HTTP port
      - "8888:8888"
      # The Web UI (enabled by --api.insecure=true)
      - "8080:8080"
    volumes:
      # So that Traefik can listen to the Docker events
      - /var/run/podman/podman.sock:/var/run/docker.sock # for podman
      - /var/run/docker.sock:/var/run/docker.sock # for docker


  whoami:
    # A container that exposes an API to show its IP address
    image: traefik/whoami
    labels:
      - "traefik.http.routers.whoami.rule=Host(`whoami.docker.localhost`)"

I installed the official Docker using the below:



sudo apt-get purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras

for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done

# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

And also installed podman using the below:

sudo apt-get update
sudo apt-get -y install podman

mkdir -p ~/.docker/cli-plugins
curl -SL https://github.com/docker/compose/releases/latest/download/docker-compose-linux-$(uname -m) -o ~/.docker/cli-plugins/docker-compose
chmod +x ~/.docker/cli-plugins/docker-compose
~/.docker/cli-plugins/docker-compose version

sudo usermod --add-subuids 200000-201000 --add-subgids 200000-201000 $USER #preferred


sudo systemctl start podman.socket # Start the systemd socket for the rootful service.
sudo systemctl enable podman.socket # Configure the socket to be automatically started after reboots.
sudo loginctl enable-linger $USER
sudo podman info | grep rootless
systemctl status podman.socket


RESULTS ARE AS FOLLOW

Engines Command Service Access Via Internet Port UFW allowed on port 8080 Volume
Docker docker compose up Traefik :white_check_mark: 8080 :white_check_mark: /var/run/docker.sock : /var/run/docker.sock # for docker
Podman podman compose up Traefik :cross_mark: 8080 :white_check_mark: /var/run/podman/podman.sock : /var/run/docker.sock # for podman

Why is there no entrypoint?

Insecure will only create one for port 8080.

You can’t bind mount two external sockets in the same internal path.

I know that mounting a docker sockets( from hosts to container ) works but my issue is working with the podman sockets( from hosts to container ), which does not work at all over the internet

Your issue is not clear. You want to mount a podman socker "over the Internet"? That doesn't really make sense to me.

AFAIK people are using podman with Traefik successfully, just search the forum for "podman".

What I'm saying is that when I use "/var/run/podman/podman.sock:/var/run/docker.sock" , I can't access traefik on port 8080 over the internet but can rather access it over the internet when using "/var/run/docker.sock:/var/run/docker.sock". I also don't know whether it's because of the label "providers.docker"