Collection of Docker-based development environments accessible via SSH, using public-key authentication.
Inspired by Microsoft's Remote SSH Visual Studio Code extension, it allows you to develop in a Docker container with your preferred language.
openssh
on Linux)ssh-keygen
on Linux)There's a Makefile
available in the repository, you can execute one of the following commands:
make cpp
make go
make java
make javascript
make php
make python
make rust
The above commands will build the desired environment(s).
By typing make
, all the environments will be built automatically.
To force a rebuild, append the flag -B
to the make command
You need to configure the docker-compose.yml
file for the desired environment, by setting the path to your local public key (on Linux, stored in ~/.ssh/
) that will be used with SSH.
After that, you can start the environments with the following commands:
make cpp-start
make go-start
make java-start
make javascript-start
make php-start
make python-start
make rust-start
The environments will be available at ports starting from 22221, listening on the localhost
address.
The default user is builder
, so if you want to connect to the docker environment, just type (e.g. the C++ environment):
ssh builder@localhost -p22221
The environments expose the following ports:
Environment | Docker Host | Docker Container |
---|---|---|
C++ | 22221 | 22 |
Go | 22222 | 22 |
Java | 22223 | 22 |
PHP | 22224 | 22 |
Python | 22225 | 22 |
Rust | 22226 | 22 |
Javascript | 22227 | 22 |
You can stop the containers by typing:
make cpp-stop
make go-stop
make java-stop
make javascript-stop
make php-stop
make python-stop
make rust-stop
And the environment will be stopped, without losing its content.
To perform a cleanup, call directly the docker-compose.yml
file you are interested in or issue the command make clean
and all the running containers will be stopped.
VSCodium, the stripped version of Visual Studio Code does not work since it requires closed source components only available in Code
Every time you rebuild an image and start a desired environment, you have to cleanup your list of authorized keys in your SSH client (in Linux, usually the file ~/.ssh/known_hosts)
If you want to save your work outside the container, you have three options:
git
command to save your work to a remote repository (e.g. GitHub, GitLab, BitBucket)docker cp
command to copy files and/or folders on your hostdocker-compose.yml
file(s) and mount a custom path as volume in the container. Be sure you have the required permissions to read/write files in the mounted volume.