balena-cli icon indicating copy to clipboard operation
balena-cli copied to clipboard

Add support for using parent context in balena build

Open StefKors opened this issue 4 years ago • 4 comments

Docker-compose supports using a context that is the parent of the current location. balena build explicitly limits this behavior to the child's scope. Originally this was added to ensure the code doesn't escape the directory you run it in. If the balena build command also supports the parent context it can improve the multi-container, multi-device workflow.

Related to this forum thread: https://forums.balena.io/t/multi-container-multi-device-with-a-single-code-base/92161

StefKors avatar Apr 08 '20 13:04 StefKors

[stefkors] This issue has attached support thread https://jel.ly.fish/#/ba5e6623-cd03-4d8e-be08-19ca39450d8d

jellyfish-bot avatar Apr 08 '20 13:04 jellyfish-bot

User has also identified another possible implementation:

" Another option might be to make it possible to specify a Docker Compose file from the CLI. For example: $ balena deploy --build --docker-compose my-docker-compose.yml "

dtischler avatar Apr 08 '20 17:04 dtischler

Docker-compose supports using a context that is the parent of the current location

It sounds like this refers to the docker-compose --file and --project-directory options:

$ docker-compose --help
...
  -f, --file FILE             Specify an alternate compose file
                              (default: docker-compose.yml)
  --project-directory PATH    Specify an alternate working directory
                              (default: the path of the Compose file)

In which case, I think it boils down to accepting the docker-compose.yml file to be in a different folder than the context = project directory, which in turns has the same effect as issue #1142 Add ability to select a docker-compose file. That issue is frequently requested and it is now very high up in the backlog.

I'll leave this issue open, but I think it could be closed when #1142 is released.

pdcastro avatar Apr 08 '20 19:04 pdcastro

[the-real-kenna] This issue has attached support thread https://jel.ly.fish/44dd2470-431d-4327-917b-51a7e22181ce

jellyfish-bot avatar Apr 15 '22 01:04 jellyfish-bot