Created
June 15, 2025 20:14
-
-
Save hubgit/4cccd848c608400b6b668219d5013001 to your computer and use it in GitHub Desktop.
Open the current directory in a Docker container (zsh function)
This file contains hidden or 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
# Open the current directory in a Docker container | |
function container() { | |
IMAGE=${1:-ubuntu:questing} | |
echo "Opening $PWD in $IMAGE" | |
docker run --rm -it -v "$PWD":/workspace -w /workspace "$IMAGE" bash | |
} | |
# Open the current directory in a Docker container (amd64) | |
function containeramd() { | |
IMAGE=${1:-ubuntu:questing} | |
echo "Opening $PWD in $IMAGE" | |
docker run --rm --platform linux/amd64 -it -v "$PWD":/workspace -w /workspace "$IMAGE" bash | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment