Follow

Is it ok to use systemd service to run docker-compose up? Seems like cheating to systemd. I wish I could manage docker containers directly with systemd services.

@sam eh, systemd does everything these days anyway, one more function wont make a difference.

@sam You can manage container using systemd, but I would recommend to use podman instead of docker.

No worries, you can use the same commands, podman just works without a daemon like dockerd.

An example can be found here: semjonov.de/post/2018-11/manag

If you really want to use docker: Don't mix docker commands with systemd services. Use docker's `--restart` feature instead which will manage the state as soon as systemd started dockerd. Otherwise you will only meet quite ugly problems.

@sheogorath Thanks for the detailed explanation and advice. I will take a look now. For ease of configuration I am using docker-compose right now. Does podman have a similar thing?

@sam Not exactly. That's what systemd is used for. Configurations can be managed by environment files as in docker-compose.

There is, of course, also the concept of pods, which you might know from K8s, but I neither use K8s nor podman in that way, that I could give practical hints here.

Sign in to participate in the conversation
Mastodon 🔐 privacytools.io

Fast, secure and up-to-date instance. PrivacyTools provides knowledge and tools to protect your privacy against global mass surveillance.

Website: privacytools.io
Matrix Chat: chat.privacytools.io
Support us on OpenCollective, many contributions are tax deductible!