devcontainers / devcontainers/spec

Support variable substitution from files/vars generated in initializeCommand

Open
#743 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
5.7k
Forks
496
PR merge metrics
No merged PRs in 30d

Description

I was using initializeCommand to calculate dynamic values (e.g., finding the real path of a Git worktree, or reading the docker image version/tag from a config file) and storing them in a .env file for Docker Compose to use as variable substitutions.
Now, I have ported all my settings from the Compose file directly into devcontainer.json and removed the Compose file entirely. However, I cannot find a way to run initializeCommand and pass those calculated values back into devcontainer.json for variable substitution (e.g., inside mounts or workspaceMount).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.