Skip to content

How to conditionally include a docker compose extension yml file only if present #536

@mshiltonj

Description

@mshiltonj

In the devcontainer.json file, we can define an array of docker compose files like so:

"dockerComposeFile": ["../docker-compose.yml", "docker-compose.extend.yml"]

However, if any file is listed here, it must exist on the file system or the container will fail to start.

In our environment, some developers will define a docker compose extension yml file and some will not.

We have added a docker-compose.override.yml line to our .gitignore file and individual developers can opt in to modifying their local development container environment if they choose.

Is this possible using a devcontainer.json configuration? I have made a few attempts, but have been unable to conditionally-include-if-present a given docker compose override/extension yml file.

If not, it would a useful feature to add.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions