Create a Docker context for remote Machine (access via SSH).
# specifiy remote user, remote IP address, context name, and the description
remote_user=<user name>
remote_ip_address=<ip address of remote system>
context_name=<name for the context>
context_description="<some description>"
# creating the context
docker context create \
${context_name} \
--docker host=ssh://${remote_user}@${remote_ip_address} \
--description ${context_description}
# list contexts
docker context list
# switch context
docker context use <context name>
Assuming an SSH key has already been created, following the instruction from: https://code.visualstudio.com/docs/containers/ssh#_set-up-ssh-tunneling
Windows
- Open PowerShell as administrator
Set-Service ssh-agent -StartupType "Automatic" Start-Service ssh-agent
- Open a non-administrator CMD window
ssh-add .ssh/<private key used for ssh to remote>