Skip to content
Snippets Groups Projects
Commit 9b972895 authored by Ulrich Kerzel's avatar Ulrich Kerzel
Browse files

fix markdown

parent 68360ded
Branches
Tags
No related merge requests found
......@@ -45,12 +45,12 @@ In the PyTorch example, we have created a local (non-root) user ("aiguru") insid
--mount type=bind,source="${PWD}",target=/home/aiguru/bindmount
However, we need to note that the user "aiguru" is local to the container and, in general, not known to the host system. In order to avoid issues with the files we create inside the container, we need to map the (Linux) user and group ID to the values we have on the host system. We do this with the following parameter:
--user=`id -u`:`id -g`
--user=\`id -u\`:\`id -g\`
However, since the users on the host and docker image typically don't have the same name, we may encounter the situation that the username for this ID does not exist in the docker container. Unless we require this for our application, it is largely a cosmetic problem for interactive use.
The full command to run the docker image with a bind-mount is then:
docker run -it --name PyTorchDS --user=`id -u`:`id -g` --mount type=bind,source="${PWD}",target=/home/aiguru/bindmount pytorchdatascience:v1.0 python bindmount/PyTorch_MNIST.py
docker run -it --name PyTorchDS --user=\`id -u\`:\`id -g\` --mount type=bind,source="${PWD}",target=/home/aiguru/bindmount pytorchdatascience:v1.0 python bindmount/PyTorch_MNIST.py
assuming that we are on the host in the local directory that contains the file PyTorch_MNIST.py that we want to execute. If we do not specify "python bindmount/PyTorch_MNIST.py", we would enter an interactive shell.
......@@ -75,7 +75,7 @@ docker rm $(docker ps -a -f status=exited -q) : remove all exited containers
docker system prune -a : everything
### Run
docker run -it --name NAME --user=`id -u`:`id -g` --mount type=bind,source=SRC_DIR,target=TARGET_DIR TAG SCRIPT
docker run -it --name NAME --user=\`id -u\`:\`id -g\` --mount type=bind,source=SRC_DIR,target=TARGET_DIR TAG SCRIPT
remove "-it" for non-interactive mode
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment