Last active
April 8, 2023 11:18
-
-
Save stefanjacobs/99fa0f8c65e24532307406fe5255580d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment