Docker + code server running web vscode

Time:2021-1-27

Install docker desktop

  • Installation address

    • Confirm whether the installation is successful
    //The version number indicates that the installation is successful
    docker -v
    • Modify docker image file
      • In visit, select the go to folder and enter ~ /. Docker
      • Found in the open directory daemon.json Document, add the following
    "registry-mirrors":["https://docker.mirrors.ustc.edu.cn"]
    • Verify whether the image is modified successfully
docker info

Docker + code server running web vscode

Get code server image

docker pull code-server

Build a new container

  • Open docker desktop and select images. There will be an image of the code server you just pulled. Click Run
  • Fill in the configuration information, as shown in the figure below

Docker + code server running web vscode

  • In the new container, click open in browser. Chrome will be opened and you need to fill in the password
  • Enter the new container, execute the following code, copy the password and enter it in chrome
nano ~/.config/code-server/config.yaml 

Docker + code server running web vscode

  • Change the URL of chrome tohttp://localhost:9999/?folder=/vscode
  • The address after folder is the file directory name of the server configured when creating a new container
  • If you modify the contents of the file, the corresponding file under local / users / ZYJ / HiPAC will be modified synchronously

The final effect

Docker + code server running web vscode