Vscode configuration connection server docker write code

The configuration steps
2. Local Docker service 3. Vscode configuration 4. use

1. Generate SSH key pairs
Ssh-keygen
all the way enter, default sound generated two files:
id_rsa
id_rsa.pub
transfer to the server, copy into a file: ~/.ssh/authorized_keys
if there is, add to the following
cat id_rsa.pud > > ~/.ssh/authorized_keys
2. Local Docker service
Docker “host= SSH ://@”
docker context create –docker “host= SSH :// @”
switch to this context:
docker context use
test :
docker info
3. Vscode configuration
Install plug-in
remote developement
docker
Use 4.
Attach Remote Host Container
server run docker
open vscode, hold shift+ CTRL +p, run docker contexts use
press shift+ CTRL +p, run remot-containers :Attach to Running Containers… , select the docker container running
and successfully press shift+k to open the docker container directory

Read More: