Skip to content

Commit

Permalink
Use system environment variables when building docker-compose (#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkmcc authored and neel-astro committed Feb 10, 2022
1 parent 276f89a commit d8e1a48
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion airflow/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/astronomer/astro-cli/config"
"github.com/astronomer/astro-cli/messages"

composeInterp "github.com/compose-spec/compose-go/interpolation"
"github.com/compose-spec/compose-go/loader"
composeTypes "github.com/compose-spec/compose-go/types"
"github.com/docker/cli/cli/config/configfile"
Expand Down Expand Up @@ -300,12 +301,14 @@ func createProject(projectName, airflowHome, envFile string, labels map[string]s

loaderOption := func(opts *loader.Options) {
opts.Name = projectName
opts.Interpolate = &composeInterp.Options{
LookupValue: os.LookupEnv,
}
}

project, err := loader.Load(composeTypes.ConfigDetails{
ConfigFiles: configs,
WorkingDir: airflowHome,
Environment: map[string]string{},
}, loaderOption)

return project, err
Expand Down

0 comments on commit d8e1a48

Please sign in to comment.