microsoft / microsoft/vscode-remote-release

code command not available in postcreatecommand when using devcontainers

Open
#8,535 12 comments 8 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

containers feature-request
Dominant language
Dockerfile
Stars
4.2k
Forks
470
Avg merge
1d 1h
Merged PRs (30d)
1

Description

Does this issue occur when all extensions are disabled?: Yes/No

Yes

  • VS Code Version: 1.77
  • OS Version: Ubuntu 22.04

Steps to Reproduce:

We use devcontainers for creating a consistent environment for our mono repository.
In that repository we have a custom extension that runs our internal tooling.
We would like to install the extension on container build such that the user always has the latest version when pulling the repository.
For this we thought to run this script:

#!/bin/bash
cd "$(dirname "$0")"

npx vsce package 

code --install-extension utils-0.0.1.vsix

in the postCreateCommand in the devcontainer.json

However we get this

line 6: code: command not found

In any other terminal we can run the code command, it seems we should be able to run this since it is after the container is created.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.