Reputation: 1
I'm trying to find a good way to run a command on a linux host machine from within a privileged docker container and I want the command to execute within the context of the host.
For example I want the ability to execute some auditing tool that scans the host. The tool is available inside the container and I want it to execute on the host.
Also, I'd like the ability to install a package on the host (specifically Auditd) from the container.
The container can be run with any privileges required for this.
Any help would be appreciated.
Upvotes: 0
Views: 1179
Reputation: 28656
Installation:
-v /:/rootfs/
) and then run cp in the container, which will copy all required files to that mount /rootfs. Be carefull with dynamic linked binaries - they must be prepared for the host OS, not for container env (they may have different lib, glibc versions).Management of host services:
-v /var/run/dbus:/var/run/dbus -v /run/systemd:/run/systemd
) and then systemd utilities (systemctl
) from the container will be able to manage host systemd servicesUpvotes: 1