Skip to content

(devcontainer) Better handling of postCreateCommand #98

@erickim555

Description

@erickim555

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions