Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
515 views
in Technique[技术] by (71.8m points)

docker - Is there a way to debug the PostCreateCommand in VSCode Devcontainers?

I am currently having this issue:

Command failed: /bin/sh -c ./.devcontainer/postCreateCommand.sh

which is the

    "postCreateCommand": "./.devcontainer/postCreateCommand.sh",

setting from the devcontainer.json.

But the script works when I deactivate the "postCreateCommand" and run it manually after container creation. Which made me think, that the issue might be the path to the script somehow. But that is not the case either. Since an empty script with just an echo command seems to work.

The script is the following:

echo "Installing Developer Requirements"

apt-get update && apt-get install -y man git
pip3 install -r .devcontainer/dev_pip_requirements.txt

Any ideas how to debug the "PostCreateCommand"? The output is less than helpful and I don't want to start reducing this project into a minimum working example.

I changed git to checkout everything with linux file endings on windows. And I triple checked that the shell script has LF endings. So those should not be an issue either. (They were previously).

question from:https://stackoverflow.com/questions/65909781/is-there-a-way-to-debug-the-postcreatecommand-in-vscode-devcontainers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...