vscode针对docker手动安装vscode server
当vscode版本更新后, 需要重新安装vscode server, 由于众所周知的原因,经常下载不下来,所以采用手动安装的方式
step1. 进入容器内部
$ docker exec -it <containerid> /bin/bash
$ cd ~/.vscode-server/bin
step2. 获得vscode 版本信息
${commit_id} = ee2b180d582a7f601fa6ecfdad8d9fd269ab1884
帮助->help
版本: 1.76.2 (user setup)
提交: ee2b180d582a7f601fa6ecfdad8d9fd269ab1884
日期: 2023-03-14T17:55:54.936Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Windows_NT x64 10.0.22621
沙盒化: No
step3. 手动下载
$ wget https://vscode.cdn.azure.cn/stable/${commit_id}/vscode-server-linux-x64.tar.gz
$ tar -zxvf vscode-server-linux-x64.tar.gz
$ mv vscode-server-linux-x64 ${commit_id}
至此重新启动vscode 连接容器
脚本自动化执行:
#bin/bash
commit_id=$1
wget https://vscode.cdn.azure.cn/stable/${commit_id}/vscode-server-linux-x64.tar.gz
tar -zxvf vscode-server-linux-x64.tar.gz
mv vscode-server-linux-x64 ${commit_id
保存至同目录下, chmod +x , 然后运行即可