Find the Docker container ID (from localhost bash):
$ export DOCKER_CONTAINER=`sudo docker ps -a --no-trunc -q`
If more than a single Docker container is running then get the PyTorch container
ID by grepping pytorch
from the docker ps -a
output, then using the final value
of the output (the container's name) we can get the container ID via docker inspect
:
$ sudo docker ps -a | grep pytorch
6b525cb4a112 nvcr.io/nvidia/pytorch:19.05-py3 "/usr/local/bin/nvid…" 7 hours ago Up 7 hours modest_austin
$ export DOCKER_CONTAINER=`sudo docker inspect --format="{{.Id}}" modest_austin`
Create a directory for our images dataset on the PyTorch Docker container:
$ export DOCKER_DATA_DIR=/root/data
$ mkdir $DOCKER_DATA_DIR
$ mkdir $DOCKER_DATA_DIR/images
$ mkdir $DOCKER_DATA_DIR/annotations
Copy images and annotations from the localhost into the PyTorch Docker container:
$ export DOCKER_DATA_DIR=/root/data
$ cd $DATA_DIR
$ sudo docker cp images/* $DOCKER_CONTAINER:$DOCKER_DATA_DIR/images
$ sudo docker cp annotations/* $DOCKER_CONTAINER:$DOCKER_DATA_DIR/annotations