tilt-dev / tilt-dev/tilt

Should `cwd` be set when using multiple docker compose files?

Open
#3,393 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
10.1k
Forks
413
Avg merge
1d 10h
Merged PRs (30d)
6

Description

Hey folks! I'm trying to run service x together with a cluster of services y. The "gateway" of services y provides a docker-compose file for all of its dependencies, as does service x. I thought I would add a Tiltfile from service x like so:

docker_compose(["./docker-compose.yml", "../service-y-gateway/docker-compose.yml"])

This mostly works, except for 1 thing. service-y-gateway's docker-compose file runs "itself" using context: ., which seems to resolve to service-x instead of service-y-gateway. I'm guessing because we run tilt up from service-x. The result, however, is that service-x is running labeled as service-y-gateway.

I had (not sure whether naively or not) expected the cwd for executing each docker-compose file to be set to that file's containing folder. Is that a fair expectation? What I'd like to prevent is having to adjust the docker-compose file for this sort of cross-service use, since it should also stay usable isolated from other docker-compose files... Would love to to hear whether I'm using tilt correctly, and if this is a use-case that can be accommodated or not.

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.

Research direction

Reproduce the setup from service-x using ./docker-compose.yml and ../service-y-gateway/docker-compose.yml in the Tiltfile. Check how each compose file resolves context when run together versus in isolation. Done means service-y-gateway's context uses its own containing folder without requiring changes that break standalone use.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose
Domain
devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.