Sign inSign up

guilhem/runinhost

By guilhem

Updated over 6 years ago

Image
0

307

guilhem/runinhost repository overview

runInHost

MicroBadger Size

Run a command on your host from a container.

Examples

Docker
$ docker run --privileged --pid=host guilhem/runinhost ls /boot/grub/
fonts
gfxblacklist.txt
grub.cfg
grubenv
unicode.pf2
x86_64-efi
Kubernetes
apiVersion: batch/v1
kind: Job
metadata:
  name: hello-host
spec:
  template:
    spec:
      hostPID: true # Facilitate entering the host mount namespace via init
      containers:
      - name: runInHost
        image: guilhem/runinhost
        imagePullPolicy: IfNotPresent
        securityContext:
          privileged: true # Give permission to nsenter /proc/1/ns/mnt
        args:
        - test
        - -f
        - /var/run/reboot-required
  backoffLimit: 4

If you are using the podSecurityPolicies you can use manifests and kustomize in ./manifests.

Under The hood

runInHost is a simple wrapper that call nsenter to execute command on host.

Tag summary

Content type

Image

Digest

Size

743.3 kB

Last updated

over 6 years ago

docker pull guilhem/runinhost