While I'm going deep on config merge logic, I realized that there may be an opportunity to clarify what should happen in a merge where lifecycle commands are stored in image metadata that are duplicates of lifecycle commands defined in the devcontainer.json or devcontainer-feature.json.
Later, you want to create a devcontainer using this prebuild (and using the same devcontainer.json). According to the spec, I believe you'd end up duplicating onCreateCommand and ending up with four entries.
EDIT: Maybe it's sufficient to expand on the metadata in image labels section to suggest avoiding using the same devcontainer.json as the one used to make the prebuild.
While I'm going deep on config merge logic, I realized that there may be an opportunity to clarify what should happen in a merge where lifecycle commands are stored in image metadata that are duplicates of lifecycle commands defined in the devcontainer.json or devcontainer-feature.json.
Consider the following:
If you prebuild the container, you'll end up with the following stored in the
devcontainer.metadata
image label:Later, you want to create a devcontainer using this prebuild (and using the same devcontainer.json). According to the spec, I believe you'd end up duplicating
onCreateCommand
and ending up with four entries.EDIT: Maybe it's sufficient to expand on the metadata in image labels section to suggest avoiding using the same devcontainer.json as the one used to make the prebuild.