Using podman compose with komodo (replacing docker sockets with podman sockets in komodo) #358

Open
opened 2025-10-31 15:09:46 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @knana1662 on GitHub (May 13, 2025).

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

CODE BASE

Ubuntu Version : 24.04
Podman Version : 4.9.3

#################################
# 🦎 KOMODO COMPOSE - SQLITE 🦎 #
#################################

## This compose file will deploy:
##   1. Sqlite + FerretDB Mongo adapter (https://www.ferretdb.com)
##   2. Komodo Core
##   3. Komodo Periphery

services:
  ferretdb:
    image: ghcr.io/ferretdb/ferretdb:1
    labels:
      komodo.skip: # Prevent Komodo from stopping with StopAllContainers
    restart: unless-stopped
    # logging:
    #   driver: ${COMPOSE_LOGGING_DRIVER:-local}
    # ports:
    #   - 27017:27017
    volumes:
      - sqlite-data:/state
    environment:
      - FERRETDB_HANDLER=sqlite
    env_file: ./compose.env  # Relative or absolute path
  
  core:
    image: ghcr.io/moghtech/komodo-core:${COMPOSE_KOMODO_IMAGE_TAG:-latest}
    labels:
      komodo.skip: # Prevent Komodo from stopping with StopAllContainers
    restart: unless-stopped
    depends_on:
      - ferretdb
    # logging:
    #   driver: ${COMPOSE_LOGGING_DRIVER:-local}
    ports:
      - 9120:9120
    env_file: ./compose.env
    environment:
      KOMODO_DATABASE_ADDRESS: ferretdb
    volumes:
      ## Core cache for repos for latest commit hash / contents
      - repo-cache:/repo-cache
      ## Store sync files on server
      # - /path/to/syncs:/syncs
      ## Optionally mount a custom core.config.toml
      # - /path/to/core.config.toml:/config/config.toml
    ## Allows for systemd Periphery connection at 
    ## "http://host.docker.internal:8120"
    # extra_hosts:
    #   - host.docker.internal:host-gateway

  ## Deploy Periphery container using this block,
  ## or deploy the Periphery binary with systemd using 
  ## https://github.com/moghtech/komodo/tree/main/scripts
  periphery:
    image: ghcr.io/moghtech/komodo-periphery:${COMPOSE_KOMODO_IMAGE_TAG:-latest}
    labels:
      komodo.skip: # Prevent Komodo from stopping with StopAllContainers
    restart: unless-stopped
    # logging:
    #   driver: ${COMPOSE_LOGGING_DRIVER:-local}
    env_file: ./compose.env
    volumes:
      ## Mount external docker socket
      - /var/run/docker.sock:/var/run/docker.sock
      ## Allow Periphery to see processes outside of container
      - /proc:/proc
      ## Specify the Periphery agent root directory.
      ## Must be the same inside and outside the container,
      ## or docker will get confused. See https://github.com/moghtech/komodo/discussions/180.
      ## Default: /etc/komodo.
      - ${PERIPHERY_ROOT_DIRECTORY:-/etc/komodo}:${PERIPHERY_ROOT_DIRECTORY:-/etc/komodo}

volumes:
  # Sqlite
  sqlite-data:
  # Core
  repo-cache:

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 9120 Volume
Docker docker compose up Komodo 9120 /var/run/docker.sock : /var/run/docker.sock # for docker
Podman podman compose up Komodo 9120 /var/run/podman/podman.sock : /var/run/docker.sock # for podman
Originally created by @knana1662 on GitHub (May 13, 2025). I'm using komodo services and want to use podman sockets over docker sockets, which when done i can't access port 9120 over the internet. ### CODE BASE **Ubuntu Version** : 24.04 **Podman Version** : 4.9.3 ```yaml ################################# # 🦎 KOMODO COMPOSE - SQLITE 🦎 # ################################# ## This compose file will deploy: ## 1. Sqlite + FerretDB Mongo adapter (https://www.ferretdb.com) ## 2. Komodo Core ## 3. Komodo Periphery services: ferretdb: image: ghcr.io/ferretdb/ferretdb:1 labels: komodo.skip: # Prevent Komodo from stopping with StopAllContainers restart: unless-stopped # logging: # driver: ${COMPOSE_LOGGING_DRIVER:-local} # ports: # - 27017:27017 volumes: - sqlite-data:/state environment: - FERRETDB_HANDLER=sqlite env_file: ./compose.env # Relative or absolute path core: image: ghcr.io/moghtech/komodo-core:${COMPOSE_KOMODO_IMAGE_TAG:-latest} labels: komodo.skip: # Prevent Komodo from stopping with StopAllContainers restart: unless-stopped depends_on: - ferretdb # logging: # driver: ${COMPOSE_LOGGING_DRIVER:-local} ports: - 9120:9120 env_file: ./compose.env environment: KOMODO_DATABASE_ADDRESS: ferretdb volumes: ## Core cache for repos for latest commit hash / contents - repo-cache:/repo-cache ## Store sync files on server # - /path/to/syncs:/syncs ## Optionally mount a custom core.config.toml # - /path/to/core.config.toml:/config/config.toml ## Allows for systemd Periphery connection at ## "http://host.docker.internal:8120" # extra_hosts: # - host.docker.internal:host-gateway ## Deploy Periphery container using this block, ## or deploy the Periphery binary with systemd using ## https://github.com/moghtech/komodo/tree/main/scripts periphery: image: ghcr.io/moghtech/komodo-periphery:${COMPOSE_KOMODO_IMAGE_TAG:-latest} labels: komodo.skip: # Prevent Komodo from stopping with StopAllContainers restart: unless-stopped # logging: # driver: ${COMPOSE_LOGGING_DRIVER:-local} env_file: ./compose.env volumes: ## Mount external docker socket - /var/run/docker.sock:/var/run/docker.sock ## Allow Periphery to see processes outside of container - /proc:/proc ## Specify the Periphery agent root directory. ## Must be the same inside and outside the container, ## or docker will get confused. See https://github.com/moghtech/komodo/discussions/180. ## Default: /etc/komodo. - ${PERIPHERY_ROOT_DIRECTORY:-/etc/komodo}:${PERIPHERY_ROOT_DIRECTORY:-/etc/komodo} volumes: # Sqlite sqlite-data: # Core repo-cache: ``` I installed the official Docker using the below: ```bash 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: ```bash 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 9120 | Volume | | ------- | ----------------- | ------- | ------------------- | ---- | ----------------------- | --------------------------------------------------------------- | | Docker | docker compose up | Komodo | ✅ | 9120 | ✅ | /var/run/docker.sock : /var/run/docker.sock # for docker | | Podman | podman compose up | Komodo | ❌ | 9120 | ✅ | /var/run/podman/podman.sock : /var/run/docker.sock # for podman |
GiteaMirror added the
seen 👀
label 2025-10-31 15:09:46 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/komodo#358
No description provided.