Created
February 7, 2021 14:40
-
-
Save thomasfaingnaert/18f16592df95e8aa3844a8826d282be9 to your computer and use it in GitHub Desktop.
Run command in Docker
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
function run_in_docker() | |
{ | |
docker run --rm -i -u "$(id -u):$(id -g)" $DOCKER_IMAGE bash -s | |
} | |
# Usage: | |
run_in_docker <<EOF || echo "Failed!" | |
set -e | |
echo "Do something in container..." | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment