File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
framework/components/dockercompose Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 1+ - Pass all environment variables to Docker Compose
Original file line number Diff line number Diff line change @@ -94,11 +94,21 @@ func New(in *Input) (*Output, error) {
9494 ctx , cancel := context .WithTimeout (context .Background (), 2 * time .Minute )
9595 defer cancel ()
9696
97+ // Start the stackwith all environment variables from the host process
98+ // set BASIC_AUTH_ENABLED and BASIC_AUTH_PREFIX to false and empty string and allow them to be overridden by the host process
99+ envVars := make (map [string ]string )
100+ envVars ["BASIC_AUTH_ENABLED" ] = "false"
101+ envVars ["BASIC_AUTH_PREFIX" ] = ""
102+
103+ for _ , env := range os .Environ () {
104+ pair := strings .SplitN (env , "=" , 2 )
105+ if len (pair ) == 2 {
106+ envVars [pair [0 ]] = pair [1 ]
107+ }
108+ }
109+
97110 upErr := stack .
98- WithEnv (map [string ]string {
99- "BASIC_AUTH_ENABLED" : "false" ,
100- "BASIC_AUTH_PREFIX" : "" ,
101- }).
111+ WithEnv (envVars ).
102112 Up (ctx )
103113
104114 if upErr != nil {
You can’t perform that action at this time.
0 commit comments