netbox-community / netbox-docker

🐳 Docker Image of NetBox
https://github.com/netbox-community/netbox-docker/wiki
Apache License 2.0
1.73k stars 800 forks source link

Support for Podman #1250

Closed sbyount closed 1 month ago

sbyount commented 1 month ago

Current Behavior

Hello, I'm trying to get the app running in Podman. It seems that the Postgres volume cannot be mounted on a Mac with Podman. Any help appreciated. https://github.com/containers/podman-compose/issues/509

From Stack Overflow ":z is required to use bind volumes for PostgreSQL because of https://github.com/docker-library/postgres/issues/116. This means that currently, it is impossible to use Mac + Podman (Rootless) + PostgreSQL (with bind volume). This is a bit sad situation, it seems like a very common usecase. Hope it changes sometime."

Expected Behavior

Application builds and launches

Docker Compose Version

podman version 4.2.1

Docker Version

podman version 4.2.1

The git Revision

0c99ff8b5663db3e0db5a45660cebda9f917508b

The git Status

On branch release
Your branch is up to date with 'origin/release'.

Startup Command

podman-compose up

NetBox Logs

['podman', '--version', '']
using podman version: 4.2.1
 ** merged:
 {
  "_dirname": "/Users/zg46503/code/netbox-docker",
  "services": {
    "netbox": {
      "image": "docker.io/netboxcommunity/netbox:v4.0-2.9.1",
      "depends_on": [
        "postgres",
        "redis",
        "redis-cache"
      ],
      "env_file": [
        "env/netbox.env"
      ],
      "user": "unit:root",
      "healthcheck": {
        "start_period": "60s",
        "timeout": "3s",
        "interval": "15s",
        "test": "curl -f http://localhost:8080/login/ || exit 1"
      },
      "volumes": [
        "./configuration:/etc/netbox/config,ro",
        "netbox-media-files:/opt/netbox/netbox/media:rw",
        "netbox-reports-files:/opt/netbox/netbox/reports:rw",
        "netbox-scripts-files:/opt/netbox/netbox/scripts:rw"
      ],
      "ports": [
        "8000:8080"
      ]
    },
    "netbox-worker": {
      "image": "docker.io/netboxcommunity/netbox:v4.0-2.9.1",
      "depends_on": {
        "netbox": {
          "condition": "service_healthy"
        }
      },
      "env_file": [
        "env/netbox.env"
      ],
      "user": "unit:root",
      "healthcheck": {
        "start_period": "20s",
        "timeout": "3s",
        "interval": "15s",
        "test": "ps -aux | grep -v grep | grep -q rqworker || exit 1"
      },
      "volumes": [
        "./configuration:/etc/netbox/config,ro",
        "netbox-media-files:/opt/netbox/netbox/media:rw",
        "netbox-reports-files:/opt/netbox/netbox/reports:rw",
        "netbox-scripts-files:/opt/netbox/netbox/scripts:rw"
      ],
      "command": [
        "/opt/netbox/venv/bin/python",
        "/opt/netbox/netbox/manage.py",
        "rqworker"
      ]
    },
    "netbox-housekeeping": {
      "image": "docker.io/netboxcommunity/netbox:v4.0-2.9.1",
      "depends_on": {
        "netbox": {
          "condition": "service_healthy"
        }
      },
      "env_file": [
        "env/netbox.env"
      ],
      "user": "unit:root",
      "healthcheck": {
        "start_period": "20s",
        "timeout": "3s",
        "interval": "15s",
        "test": "ps -aux | grep -v grep | grep -q housekeeping || exit 1"
      },
      "volumes": [
        "./configuration:/etc/netbox/config,ro",
        "netbox-media-files:/opt/netbox/netbox/media:rw",
        "netbox-reports-files:/opt/netbox/netbox/reports:rw",
        "netbox-scripts-files:/opt/netbox/netbox/scripts:rw"
      ],
      "command": [
        "/opt/netbox/housekeeping.sh"
      ]
    },
    "postgres": {
      "image": "docker.io/postgres:16-alpine",
      "env_file": [
        "env/postgres.env"
      ],
      "volumes": [
        "netbox-postgres-data:/var/lib/postgresql/data"
      ]
    },
    "redis": {
      "image": "docker.io/redis:7-alpine",
      "command": [
        "sh",
        "-c",
        "redis-server --appendonly yes --requirepass $REDIS_PASSWORD"
      ],
      "env_file": [
        "env/redis.env"
      ],
      "volumes": [
        "netbox-redis-data:/data"
      ]
    },
    "redis-cache": {
      "image": "docker.io/redis:7-alpine",
      "command": [
        "sh",
        "-c",
        "redis-server --requirepass $REDIS_PASSWORD"
      ],
      "env_file": [
        "env/redis-cache.env"
      ],
      "volumes": [
        "netbox-redis-cache-data:/data"
      ]
    }
  },
  "volumes": {
    "netbox-media-files": {
      "driver": "local"
    },
    "netbox-postgres-data": {
      "driver": "local"
    },
    "netbox-redis-cache-data": {
      "driver": "local"
    },
    "netbox-redis-data": {
      "driver": "local"
    },
    "netbox-reports-files": {
      "driver": "local"
    },
    "netbox-scripts-files": {
      "driver": "local"
    }
  },
  "version": "3.4"
}
podman logs netbox-docker_netbox_1
Error: channel "123" found, 0-3 supported: lost synchronization with multiplexed stream
exit code: 125

Content of docker-compose.override.yml

version: '3.4'
services:
  netbox:
    ports:
      - 8000:8080