Command-Line Options
systemd-docker provides a few simple but powerful flags to control its behavior. These options let you fine-tune how it integrates with systemd and the container.
Basic Usage
systemd-docker [flags] -- [docker flags]
Everything before -- configures systemd-docker itself. Everything after -- is passed directly to docker run.
Available Flags
-c, --cgroups
Takes ownership of one or more cgroups.
You can specify multiple, or use all to grab all available cgroups.
Useful when fine-tuning resource control with systemd.-e, --env
Passes the environment variables from the systemd service environment into the container.
Without this, the container starts with a clean env.-h, --help
Displays the help message.- -l, --logs
Pipes the container logs to stdout, so they show up in journalctl.
Defaults to true, which is usually what you want. -n, --notify
Enables systemd notify integration.
Lets the container send READY=1 or similar signals to tell systemd when it’s fully started.-p, --pid-file
Writes the container’s PID to a file.
This is useful for monitoring or integrating with other tooling.-v, --version
Shows the version of systemd-docker.