Currently, we use postCreateCommand to run .devcontainer/post-create.sh, which sets up the env for things like ruby/jekyll.
However, when one exits the Docker container and re-enters it (eg via "Reopen container"), the changes made by post-create.sh are lost. Thus, the dev has to manually re-run ./.devcontainer/post-create.sh, which isn't ideal for dev ergonomics.
Here are two alternatives:
(1) Use postStartCommand rather than postCreateCommand.
(2) Create a custom Dockerfile that performs the ruby/jekyll setup that post-create.sh does.
(1) is a little slower than (2), as in (1) we'll have to re-run the ruby/jekyll setup each time we re-enter the container (which does take ~30 seconds or so).
For more info, see:
https://code.visualstudio.com/docs/devcontainers/create-dev-container#_rebuild
https://code.visualstudio.com/docs/devcontainers/create-dev-container#_dockerfile
Currently, we use
postCreateCommandto run.devcontainer/post-create.sh, which sets up the env for things like ruby/jekyll.However, when one exits the Docker container and re-enters it (eg via "Reopen container"), the changes made by
post-create.share lost. Thus, the dev has to manually re-run./.devcontainer/post-create.sh, which isn't ideal for dev ergonomics.Here are two alternatives:
(1) Use
postStartCommandrather thanpostCreateCommand.(2) Create a custom Dockerfile that performs the ruby/jekyll setup that
post-create.shdoes.(1) is a little slower than (2), as in (1) we'll have to re-run the ruby/jekyll setup each time we re-enter the container (which does take ~30 seconds or so).
For more info, see:
https://code.visualstudio.com/docs/devcontainers/create-dev-container#_rebuild
https://code.visualstudio.com/docs/devcontainers/create-dev-container#_dockerfile