for quickly setting up a dev container accessible through ssh
./up --buildor to run in background
./up --build -dauthorized_keyscomes from my dotfiles repository. if you would like to use this container for yourself fork and/or create your own dotfiles repo with your own configuration (or at least your own keys) and update theDockerfileto reflect the new dotfiles repo location.- if no $SSH_SOCK_AUTH is set, will default to Docker Desktop/Colima (
colima start --ssh-agent) default of /run/host-services/ssh-auth.sock, this allows agent forwarding from host -> vm -> container- if you see
failed to convert agent configerror when running./upthen $SSH_SOCK_AUTH is probably not set when it should be. no local ssh-agent and/or no ssh-auth.sock from vm provider.
- if you see
- the dev container will be accessible on port 2222 as "dev" user (e.g. ssh dev@localhost -p 2222 if your user is in
authorized_keys)
optionally configure your container for commit signing. ssh key signing is preferable to gpg signing since you can re-use the existing ssh-agent socket for signing commits.
git config --global gpg.format ssh # (if not already set from dotfiles)
# publickey is coming from dotfiles, otherwise you need to copy to container
git config --global user.signingkey ~/.ssh/<keyfile>.pub
# gpgsign is used for ssh signing as well
git config --global commit.gpgsign trueall of these commands can either be in the global config or local repo config if some repos require
signing and others don't. if you're stowing ~/.gitconfig from your dotfiles repo it might be preferable
to configure these things in ~/.gitconfig.local and include that from your ~/.gitconfig.
you can shell into the dev container as dev with
./dshor if you want to install more tools you can either update the Dockerfile and recreate the container or shell into container as root and install them
./dsh rootclone your project repo somewhere inside the container and then it will be accessible through remote ssh. your project files should all remain in the container. using a docker volume with a bind mount to the host machine would be extremely slow if indexing, installing node dependencies, etc.