Skip to content

Instantly share code, notes, and snippets.

@chakkritte
Created July 9, 2020 05:00
Show Gist options
  • Save chakkritte/b2e6fdb26cf86104c612f7260bedffda to your computer and use it in GitHub Desktop.
Save chakkritte/b2e6fdb26cf86104c612f7260bedffda to your computer and use it in GitHub Desktop.
#!/bin/sh
# base image docker
BASE=ufoym/deepo
# name of container
NAME=$1
# directory
DIR=/home/$(whoami)
export UID=$(id -u)
export GID=$(id -g)
nvidia-docker run --name $NAME -ti \
-e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix \
-v $DIR:"/home/$USER" \
--user $UID:$GID \
--workdir="/home/$USER" \
--volume="/etc/group:/etc/group:ro" \
--volume="/etc/passwd:/etc/passwd:ro" \
--volume="/etc/shadow:/etc/shadow:ro" \
$BASE bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment