A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://code.visualstudio.com/docs/containers/ssh below:

Connect to remote Docker over SSH

Connect to remote Docker over SSH

We recommend using the Visual Studio Code Remote - SSH extension to connect to a remote machine running Docker engine. You can use the Remote - SSH and Dev Containers extensions together. You may review the steps in the Dev Containers documentation.

It is also possible to connect to the remote Docker engine directly using SSH tunneling, which you can read more about below.

Set up SSH Tunneling
  1. Use ssh-keygen or similar to get and configure a public/private key pair for SSH authentication. Password authentication is not supported by Docker and not possible with a DOCKER_HOST-based configuration. If a key pair has already been set up, it can be used.

  2. Configure ssh-agent on the local system with the private key file produced above.

  3. Verify that your identity is available to the agent with ssh-add -l. It should list one or more identities that look something like 2048 SHA256:abcdefghijk somethingsomething (RSA). If it does not list any identity, you will not be able to connect. Also, it needs to have the right identity. If the Docker CLI is working, the Container Explorer should work. The Container Explorer window uses the Docker CLI, which in turn uses the ssh command, and benefits from an automatically inferred configuration.

  4. Create a Docker context that points to the remote machine running Docker. Use ssh://username@host:port as the Docker endpoint (replace "host" with your remote machine name, or the remote machine IP address). Issue the following command from terminal window:

    docker context create my-remote-docker-machine --docker "host=ssh://username@host:port"
    

    Always include the user name in the Docker endpoint address, even if it is the same as the local user name. If you omit the port, it defaults to 22.

  5. Use the Command Palette (⇧⌘P (Windows, Linux Ctrl+Shift+P)) to issue the Docker Contexts: Use command to activate the Docker context pointing to the remote machine. This command causes both VS Code and Docker CLI to use the remote machine context.

    If you don't have this command, make sure to install the Container Tools extension.

  6. It is recommended to change the refresh rate to something longer than the default with the containers.explorerRefreshInterval setting. The connection over SSH is slow, and it can result in trying to refresh again before the previous refresh even finished. We recommend at least 3000 ms.

Tips

11/21/2022


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4