I'm not an expert, but I think we need more information.
Selfhosted
A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.
Rules:
-
Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.
-
No spam posting.
-
Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.
-
Don't duplicate the full text of your blog or github here. Just post the link for folks to click.
-
Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).
-
No trolling.
Resources:
- selfh.st Newsletter and index of selfhosted software and apps
- awesome-selfhosted software
- awesome-sysadmin resources
- Self-Hosted Podcast from Jupiter Broadcasting
Any issues on the community? Report it using the report flag.
Questions? DM the mods!
I'm even less of an expert lol. What information can I provide to help?
The commands you used to start the docker containers, or the docker compose contents.
That's what dictates how much "power" a docker container has
It sounds to me like one (or more) of your containers is referencing something on your storage drive, but Docker is loading before your drive gets mounted. When Docker sees that the folder its trying to access doesn't exist, it creates it, blocking your drive from taking that name.
To fix it, you would need to make sure your storage drive is mounted before Docker starts, how you do that is down to you and your particular setup though.
That's a good theory. This may be able to be investigated further with systemd-analyze plot > boot.svg
It looks like you're relying on media automounting to access the drive, but this is happening too late for Docker.
I would suggest creating the empty folder and explicitly adding the mount to /etc/fstab
instead. This should mount early enough, and even if it doesn't it needs an empty folder for the mount point anyway.
Edit: Make sure you reference the partition by UUID, because the device name of USB devices sometimes change after a reboot.
Agreed. Needs to be a required mount in fstab. System won't even start then if the mount fails, docker always has access
Thanks - this was the solution. I've updated the post to reflect the solution I used.
Is Docker starting up and one of the containers mounts a volume to a /storage folder on the host? That could explain it but I’m not super clear on all that’s going on in your system.
Quick test: disable auto start on all your containers and restart and see if it recurs.
I believe that's exactly what is happening. I just don't know how to fix it. I could edit the YML files and delete restart: unless-stopped
but I want my containers to restart if something goes down unexpectedly
So is the issue that your extra drive mounts to /storage, but that happens after Docker has already started and taken over the directory, so the mount fails? Normally I’d expect it to happen in the other order. Is this a weird race condition?
This might be a good thing to run through with ChatGPT- there are probably ways to delay the Docker container start, but maybe there’s a more significant misconfiguration you can deal with.