Last active
July 26, 2017 14:40
-
-
Save tnarihi/6d88ee3b784d05acecfef7afe353ec91 to your computer and use it in GitHub Desktop.
My Docker bashrc
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
alias docker_build="docker build --build-arg http_proxy=${http_proxy} --build-arg https_proxy=${https_proxy}" | |
alias docker_run="nvidia-docker run -ehttp_proxy=${http_proxy} -ehttps_proxy=${https_proxy} -eftp_proxy=${ftp_proxy} --rm" | |
docker_run_user () { | |
tempdir=$(mktemp -d) | |
getent passwd > ${tempdir}/passwd | |
getent group > ${tempdir}/group | |
nvidia-docker run -ehttp_proxy=${http_proxy} -ehttps_proxy=${https_proxy} -eftp_proxy=${ftp_proxy} -v${HOME}:${HOME} -w$(pwd) --rm -u$(id -u):$(id -g) $(for i in $(id -G); do echo -n ' --group-add='$i; done)\ | |
-v ${tempdir}/passwd:/etc/passwd:ro -v ${tempdir}/group:/etc/group:ro "$@" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment