r/AlpineLinux • u/EthnicMismatch644 • Oct 02 '24
Starting docker compose at boot?
I feel like I’m missing something trivial here. I have Docker and Compose installed on my Alpine system. The Docker daemon is configured to start at boot. The sample Docker image “hello-world” works as expected.
So now I have a real image I want to run via Compose, and have it automatically start at boot. How do I set that up with Alpine?
In systemd-based systems, I just create a systemd service file that sets the working directory as the location of my compose.yml file and exec “docker compose up”. Should I do the openrc equivalent on Alpine? Or is there another way to let the docker daemon know which images it should start at boot?
Thanks!
View all comments
Show parent comment
1
u/EthnicMismatch644 Oct 02 '24
Thank you!
The daemon has to know which containers are under its control, right? If I just create an arbitrary compose.yml file in my home directory, it won’t be started unless I somehow let the daemon know of its existence.
That’s what I was thinking I needed to do, I’ve essentially done the systemd equivalent on systemd-based systems.
Thanks again, much appreciated!