This is a docker image that imports a base image and adds dev-container functionalities for SSH'ing into the container and setting up the working environment once the connection is established.
Docker ontainers are available on dockerhub: simonlenau/dev-container
To allow a connection inside the container, a SSH server is started
using Dropbear.
The server is started running the /dropbear_init
script
Some default SSH keys for host & user are stored in scripts/ssh_keys/
.
The default keys are publicly available on github
!!! Please replace these keys before using the container !!!
The default SSH keys can be replaced by
- mounting a folder to
/dev-container/ssh_keys
with files corresponding to those inscripts/ssh_keys/
and/or - running
/dev-container/run/ssh_key_setup "generate"
inside the container
When combining 1. and 2., the keys will be (re)placed the in mounted folder and easily re-usable.
To connect to the SSH server inside the container, tools like OpenSSH or Dropbear may be used.
The working environment is defined by two folders defined in environment variables
${WORKDIR}
and ${OUTDIR}
.
Once a client connects into the container using SSH,
scripts/run/ssh_entrypoint
is source
ed.
It executes the following steps:
- If an environment file
~/.env
or/.env
exists, source it. - If an entrypoint script
/.entrypoint
exists, source it - If user does not object: open
${WORKDIR}
in vscode and/or terminal