resolveAndMergeBuildArgs returns the final set of build arguments to use for the service image build. First, args directly defined via `build.args` in YAML are considered. Then, any explicitly passed args in opts (e.g. via `--build-arg` on the CLI) are merged, overwriting any keys that already exis
(proxyConfig map[string]string, project *types.Project, service types.ServiceConfig, opts api.BuildOptions)
| 250 | // Finally, standard proxy variables based on the Docker client configuration are added, but will not overwrite |
| 251 | // any values if already present. |
| 252 | func resolveAndMergeBuildArgs(proxyConfig map[string]string, project *types.Project, service types.ServiceConfig, opts api.BuildOptions) types.MappingWithEquals { |
| 253 | result := make(types.MappingWithEquals). |
| 254 | OverrideBy(service.Build.Args). |
| 255 | OverrideBy(opts.Args). |
| 256 | Resolve(envResolver(project.Environment)) |
| 257 | |
| 258 | // proxy arguments do NOT override and should NOT have env resolution applied, |
| 259 | // so they're handled last |
| 260 | for k, v := range proxyConfig { |
| 261 | if _, ok := result[k]; !ok { |
| 262 | v := v |
| 263 | result[k] = &v |
| 264 | } |
| 265 | } |
| 266 | return result |
| 267 | } |
| 268 | |
| 269 | func getImageBuildLabels(project *types.Project, service types.ServiceConfig) types.Labels { |
| 270 | ret := make(types.Labels) |
no test coverage detected