The first thing you need to do is to create a directory in which you can store docker and ssh related files.
As an example, we will create a directory named remote_dev inside our project and move into that directory with the command:
mkdirremote_dev&&cdremote_dev
Step 2 — Create SSH key
On your client system – the one you’re using to connect to the server – you need to create a pair of key codes.
To generate a pair of SSH key codes, enter the command:
ssh-keygen-trsa-b4096-fmy_key
Files my_key and my_key.pub will be created in the working directory.
SSH Keys
Step 3 — Docker Image
Let's create all the files necessary for building the container.
1. Create Dockerfile
Let's create a simple image in which we will deploy the SSH server:
remote_dev/Dockerfile
Add a script to start the server:
remote_dev/sshd_daemon.sh
2. Create docker-compose
Since we need a GPU inside the container, we will take Image with pre-installed CUDA as a basis and set runtime to nvidia.
For convenience, let's create a docker-compose file: