librenms / docker

LibreNMS Docker image
MIT License
691 stars 278 forks source link

Suggestion: set project name to "librenms" in docker-compose.yml #325

Closed candlerb closed 1 year ago

candlerb commented 1 year ago

Behaviour

Steps to reproduce this issue

  1. cd examples/compose
  2. docker compose up -d

Expected behaviour

The docker-compose project to be called "librenms"

Actual behaviour

The created project is called "compose" (see docker compose ls), and so are other resources which are named from it, such as the network:

$ docker network list
NETWORK ID     NAME                    DRIVER    SCOPE
...
bae06792b684   compose_default         bridge    local

This is because the project name defaults to the name of the enclosing directory, which indeed in this case is "compose".

However this is easily fixed by adding a top-level "name" setting to docker-compose.yml, i.e.

version: "3.5"
name: librenms     # <<<< ADD THIS

services:
   ... etc

(Aside: it can still be overridden by docker compose up -p <projectname>, in case you want to run multiple instances of the librenms stack concurrently)

Configuration

murrant commented 1 year ago

sounds reasonable, I suggest sending a change request for the same.