microsoft / microsoft/vscode-remote-release

[docker-compose] Only rebuild target "service" on container rebuild

Open
#2,795 5 comments 4 reactions 1 assignee View on GitHub

@chrmarti is already working on this.

Since Apr 24, 2020.

containers feature-request
Dominant language
Dockerfile
Stars
4.2k
Forks
470
Avg merge
1d 1h
Merged PRs (30d)
1

Description

For repositories that have multiple containers, it should be possible to limit rebuilds to the single service targeted by devcontainer.json when using docker-compose.

Given a repository like:

monorepo/
  monorepo.code-workspace
  docker-compose.yml
  backend/
    Dockerfile
    .devcontainer/
      devcontainer.json
  frontend/
    Dockerfile
    .devcontainer/ 
      devcontainer.json

Modifications to either devcontainer.json will require triggering a rebuild, but doing so appears to run basically the raw docker-compose build command and then remove/start all containers. (As opposed to docker-compose build backend or docker-compose build frontend.)

In turn, if one VSCode window is open for each of the containers the container not being rebuilt will lose connection to the container since it's been destroyed.

This problem will be more acute if the improved multi-container support in #1460 is implemented but could also be solved separately.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.