Unix & Linux Asked on December 6, 2021
Docker provides for the ability to run a command when the container starts. This is specified with CMD
in the Dockerfile.
However, if I want my container to start with systemd I have to use,
CMD ["/usr/sbin/init"]
Only then is init in ps1. If this is required, is CMD
of any use? Is there anyway to start systemd, and have it start another process too from the command line, or what podman run
specifies?
There are multiple different dumb init processes for containerization like, catatonit
, dumb-init
, and tini
but they’re all "dumb". I want a real systemd init with the ability to specify the process after the default.target is hit.
You’re using CMD
to configure your container to start systemd, so it seems to me it is “useful”.
To start another command in your container, either:
docker exec
;Answered by Stephen Kitt on December 6, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP