Use system environment variables when building docker-compose #495
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Since version v0.27.2, host system environment variables are no longer able to be used in
docker-compose.override.yml
files for e.g. local development, this change passes along a pointer to thecompose-go
to use the system environment variables.We have a local
docker-compose.override.yml
that tries to define volume which references a local path that includes an environment variable, like:As our team has gradually updated our
astro-cli
version, we noticed when runningastro dev
commands that we would get failures starting up because of a missing expected file and warnings that sayWARN[0000] The "HOME" variable is not set. Defaulting to a blank string.
I believe the issue was introduced in the migration from
libcompose
, which handles parsing environment variables for you by default if you passEnvironment = nil
, andcompose-go
, which does not. Unfortunately I do not know go, but I managed to put this change together and it works locally. Please let me know if you have any pointers on how to add tests or make any further changes :) Thanks!馃師 Issue(s)
Can't create issues on the repo externally.
馃И Functional Testing
Create
docker-compose.override.yml
similar to above and try runningastro dev start
orastro dev stop
馃摳 Screenshots
馃搵 Checklist
make test
before taking out of draft