I have created a devcontainer with a postCreateCommand and a postStartCommand.
If I’m using the Visual Studio Code Remote - Containers in a local environment both are executed. If i’m using the Codespaces beta, only the postCreateCommand is executed.
My decontainer has these two statements
“postCreateCommand”: “bash .devcontainer/postCreate.sh”,
“postStartCommand”: “nohup bash -c ‘.devcontainer/postStart.sh &’”,
The reason I have nohup for the postStartCommand is to make sure the process that it kicks off stays running. The process i kick off is a web app that i would like to be starting when the container is running so that the end user does not have to do a manual step to start it up.
the postStart.sh file is pretty basic. it’s just
./application -p startup
as mentioned before this starts up the process in my local environment, but not my codespaces environment. I know it’s not invoking the script because i also tried some basic chmod 777 on some of my files to see if they change in the container.