Skip to content

Dev-container functionalities for ssh'ing into imported container images

License

Notifications You must be signed in to change notification settings

simon-lenau/dev-container

Repository files navigation

dev-container

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

SSH connection

SSH server

To allow a connection inside the container, a SSH server is started using Dropbear.
The server is started running the /dropbear_init script

SSH keys

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 !!!

Replacing default SSH keys

The default SSH keys can be replaced by

  1. mounting a folder to /dev-container/ssh_keys with files corresponding to those in scripts/ssh_keys/ and/or
  2. 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.

Connecting to the SSH server

To connect to the SSH server inside the container, tools like OpenSSH or Dropbear may be used.

Working environment set-up

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 sourceed. It executes the following steps:

  1. If an environment file ~/.env or /.env exists, source it.
  2. If an entrypoint script /.entrypoint exists, source it
  3. If user does not object: open ${WORKDIR} in vscode and/or terminal

About

Dev-container functionalities for ssh'ing into imported container images

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published