Skip to content

Instantly share code, notes, and snippets.

View stefanjacobs's full-sized avatar
🚀
To the stars...

Stefan stefanjacobs

🚀
To the stars...
View GitHub Profile
#!/bin/bash
# Create a script that enters a pids namespace and sets its environment variables, e.g. enter a docker container without `docker exec`
echo "sudo /usr/bin/nsenter --target \$1 --mount --uts --ipc --net --pid env -i - \$(sudo cat /proc/\$1/environ | xargs -0) bash" > enterDocker.sh; chmod +x enterDocker.sh;