Precis: I want to start Systemd services AND run a shell-script based task in a Docker container - suggestions?
I’ve inherited some CentOS6 based Docker containers that create OVF virtual images. They require the libvirt service to be running which on CentOS6 was not a problem. The container RUN command was used to run a script, the script started the services and all was well.
But on CentOS7, such services are started using Systemd and here my fun starts. All the Systemd examples use RUN to call /bin/init to start Systemd leaving me no ‘hook’ to run my shell script. I’ve also not managed to figure out how to start Systemd from the shell script if I used RUN to start the script (is there some key bit I’ve overlooked?).
So anyone solved this sort of problem already?
FYI, if you’re wondering why, we have a number of products running on different levels of Linux and need to build OVFs, from a single machine, for each of them so Docker has been used to create isolated environments to do this.