This Docker image sets up a GPU-enabled development server environment with SSH access, several development and system tools installed, and the option to use TUNA mirrors for faster downloads.
- Docker 19.03 or later
- Git (optional, for cloning the repository)
-
Clone this repository (optional, if you haven't done so yet):
git clone https://github.com/Outsider565/Docker_GPU_Dev_Server.git cd Docker_GPU_Dev_Server
-
Run the build script and provide the requested inputs. You can also just press enter to use the default values:
chmod +x build.sh ./build.sh
The build script prompts you for several ARG values to be used during the Docker build. The ARG values are:
- LANG (default: en_US.UTF-8)
- ADMIN_PASSWORD (default: "")
- SSH_PUB_KEY (default: "")
- SSH_AUTHORIZED_KEYS (default: "")
- GOST_URL (default:
https://github.com/ginuerzh/gost/releases/download/v2.11.5/gost-linux-amd64-2.11.5.gz
) - GIT_USER_NAME (default: "")
- GIT_USER_EMAIL (default: "")
- USE_TUNA_MIRROR (default: true)
- Docker image tag (default: outsider565/gpu_devdocker:test)
-
After running the script, Docker will build your image according to the Dockerfile and your inputs.
If you do not wish to build the image yourself, you can pull the pre-built image from Docker Hub:
docker pull outsider565/gpu_devdocker:tagname
To start a container from your Docker image, run the following command, replacing <tag>
with the Docker image tag you chose when you built the image, and <FORWARD_SERVER>
and <FORWARD_PORT>
with your own forward server and port information:
Example:
docker run -d -e FORWARD_SERVER="<FORWARD_SERVER>" -e FORWARD_PORT="<FORWARD_PORT>" --gpus all outsider565/gpu_devdocker:<tag>
The FORWARD_SERVER
should be deployed with gost server, the format should be IP:PORT
.
The FORWARD_PORT
is the port you want to map the 22 port of the container to.
After running this command, you should be able to SSH into your container using the ADMIN_PASSWORD(default as testadminpassword) you set during the build, with the command:
ssh admin@<FORWARD_SERVER.IP> -p <FORWARD_PORT>
You can test whether pytorch can use GPU by running the following command:
python -c "import torch; print(torch.cuda.is_available(), torch.cuda.device_count())"
Please feel free to reach out with any issues or questions. You can refer to the Dockerfile for more information on the tools installed in the image.