Hey everyone! I'm relatively new to Docker and have a decent technical background, but I'm running into some issues. I've set up a Docker Compose file for my Plex server, and it works fine initially. However, whenever I make any edits to the configuration, even minor ones, I encounter errors when I try to bring it up again.
Here's my current configuration:
```yaml
plex:
image: lscr.io/linuxserver/plex:latest
container_name: plex
volumes:
- /mnt/data/media:/data/media
- ./config/plex:/config
devices:
- "/dev/dri:/dev/dri"
environment:
- PUID=1000
- PGID=1000
- version=docker
ports:
- 32400:32400
restart: unless-stopped
```
After making changes like adding an environment variable for `PLEX_CLAIM` (which is part of the documentation) and removing the optional device lines, I get an error when running `docker-compose up plex`. The errors include:
```plaintext
ERROR: for plex 'ContainerConfig'
KeyError: 'ContainerConfig'
```
I've tried validating my YAML online, copying and pasting, typing it out by hand, and even using dos2unix to tackle any weird characters. Yet I'm still stuck. Any advice on how to fix this? Thanks!
3 Answers
It looks like there might be some indentation issues in your YAML. Sometimes, when pasting into forums like this, the formatting can get messed up. Make sure all your tabs and spaces are consistent. This can lead to those pesky errors when Docker tries to parse the file. You might want to try using an online YAML checker to pinpoint any formatting issues!
Another thing to check is whether you've included the `services:` line before your service definitions. If you're missing that, Docker won't recognize what's supposed to be inside your Compose file. Also, if you’re configuring devices, make sure not to use quotes around them; that could lead to issues as well.
Just a heads up, but it seems like you're using a pretty old version of Docker Compose. Sometimes, compatibility issues can pop up if you're running an outdated version. Consider updating it to see if that resolves some of your support issues!
Good call! A consistent format is super important in YAML, especially with Docker Compose. It had me pulling my hair out when I started too!