Skip to content

What's the best way to run a script after the container has come up? #455

Answered by ctalledo
aaomidi asked this question in General
Discussion options

You must be logged in to vote

Hi @aaomidi, if the Sysbox container has systemd in it, then the natural way to automatically run a program inside is to create a systemd service for it (just as you would on a bare-metal machine or VM).

For example, you could create a Dockerfile that uses nestybox/ubuntu-focal-systemd as a base image, and then copy into it a systemd unit / service that automatically starts the program you want. Refer to the systemd docs for details on how to do this.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by aaomidi
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants