Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mshiltonj opened this issue Jan 3, 2025 · 0 comments

Comments

@mshiltonj
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant