Closed milabs closed 1 year ago
This can be achieved like so:
{
containers.demo = {
config = ...;
};
# Commands executed on the host
systemd.services."container@demo" = {
preStart = "...";
postStart = "...";
preStop = "...";
postStop = "...";
};
}
This pattern is used internally by extra-container
, e.g. for implementing enableWAN
.
Wow, thanks. Haven't found that by myself.
Hello,
It would be nice to have the ability to add start/stop commands for the container, executed on the host side.
For example, in a project I've working on I have to add some
iptables
rules once container started.