librenms / docker

LibreNMS Docker image
MIT License
691 stars 278 forks source link

service 'name' must be a mapping not a string #330

Closed dewiweb closed 1 year ago

dewiweb commented 1 year ago

Behaviour

Can't launch librenms-docker on centos7 with docker-compose.yml

Steps to reproduce this issue

  1. sudo docker-compose up

Expected behaviour

ERROR: In file './docker-compose.yml', service 'name' must be a mapping not a string.

Tell me what should happen

Actual behaviour

Tell me what happens instead

Configuration

Server: Docker Engine - Community Engine: Version: 20.10.17 API version: 1.41 (minimum version 1.12) Go version: go1.17.11 Git commit: a89b842 Built: Mon Jun 6 23:03:33 2022 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.6 GitCommit: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1 runc: Version: 1.1.2 GitCommit: v1.1.2-0-ga916309 docker-init: Version: 0.19.0 GitCommit: de40ad0

Docker info

> Output of command `docker info`

Logs

> Container logs (set LOG_LEVEL to debug if applicable)
seaplusplus commented 1 year ago

https://github.com/librenms/docker/commit/453b31cc641a5ebb4984fe976ca6ef3b1d133c36

This commit breaks it. Change name to version gets it working again.

joshbuker commented 1 year ago

I noticed that docker compose up -d will work with the name, while docker-compose up -d does not. Not sure if this is because docker compose is more lenient in what it accepts in the compose file, but it's probably related.

EpicLPer commented 1 year ago

From what I just read there's a "docker-compose" and "docker compose", one is a standalone thing while the other is a plugin for the actual Docker CLI.
v1 doesn't come (?) with the "compose" option, but v2 does. Upgrading my installation right now to test this out.

EpicLPer commented 1 year ago

Yep, that seems to have been the solution. "docker compose version" now works too, so an upgrade of the packages seems to be the solution.

As a PSA, v1 seems to go out of support in June 2023, so an upgrade is probably good anyways :)

crazy-max commented 1 year ago

docker-compose v1 is EOL, please update to v2