Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

when using dockerComposeFile prebuilds are ignored

Open
#867 2 comments 0 reactions 1 assignee View on GitHub

@chrmarti is already working on this.

Since Sep 3, 2024.

Assessment

This issue has not been assessed yet.

Description

bug

We have the following devcontainers.json file at .devcontainers/flask/devcontainers.json:

{
	"name": "flask",
	"dockerComposeFile": [
		"../../docker-compose.app.yaml",
		"../docker-compose.app.dev.yaml"
	],
	"service": "flask",
	"workspaceFolder": "/home/jan",
	"features": {},
	"customizations": {
		"vscode": {
			"settings": {
				...
			},
			"extensions": [
				...
			]
		}
	}
}

Running devcontainer up --workspace-folder . --config .devcontainer/flask/devcontainer.json works fine, it builds the image and stands up the docker compose service.

I want to utilize prebuilding with our docker compose stack so I take the resulting built images and push them to our repository. If anyone pulls those images and runs devcontainer up --workspace-folder . --config .devcontainer/flask/devcontainer.json it rebuilds the entire image from scratch

If in the devcontainers.json I use the image field then it doesn't rebuild but there's no good way to use something like VS Code's > Reopen in Container since it doesn't know it part of the docker compose stack.

Does devcontainers support using prebuilt images with docker compose files? Is there somethings special I need to do to get it to recognize the image is fully built or to point directly at the cache?

To me it seems like it seems to be running docker compose build instead of docker compose up when running devcontainers up. If I run docker compose up myself and then attach VS Code it seems to work as intended.

Dominant language
TypeScript
Stars
3k
Forks
461
Avg merge
18m
Merged PRs (30d)
5

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from devcontainers/cli

All issues in devcontainers/cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.