[英]How to open files in a Docker container outside of container using the Remote Development extension for VSCode
[英]How can I run VS Code's Extension Development Host in a Docker container to test my vscode extension?
我正在尝试使用 GitHub Actions 测试我的 vscode 扩展,这意味着 Visual Studio Code 需要位于 Docker 容器中。 有没有人做过这个? 有谁知道如何做到这一点?
您可以通过使用工作流程设置 ubuntu 容器并安装 vscode 来完成此操作。 使用容器而不是安装在 ubuntu-latest 内部的原因是为了确保我们从一个干净的实例开始
包含设置的工作流片段
ci:
name: Build
runs-on: ubuntu-latest
container:
image: ubuntu:trusty
steps:
- uses: actions/checkout@v2
- name: Install vscode
run: |
apt-get update
apt-get clean
apt-get install -y wget
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
sh -c 'echo "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
apt-get install -y apt-transport-https
apt-get update
apt-get install -y code
Vscode 测试扩展从这里我们可以编写任何必要的步骤来测试我们的扩展,如您所知https://code.visualstudio.com/api/working-with-extensions/testing-extension
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.