Skip to content

Commit

Permalink
fix: handle blank build args appropriately
Browse files Browse the repository at this point in the history
  • Loading branch information
baspetersdotjpeg authored and edvald committed Jul 25, 2019
1 parent 50c5720 commit 33c12eb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion garden-service/src/plugins/container/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,15 @@ export function getDockerBuildFlags(module: ContainerModule) {
const args: string[] = []

for (const [key, value] of Object.entries(module.spec.buildArgs)) {
args.push("--build-arg", `${key}=${value}`)

// 0 is falsy
if (value || value === 0) {
args.push("--build-arg", `${key}=${value}`)
} else {
// If the value of a build-arg is null, Docker pulls it from
// the environment: https://docs.docker.com/engine/reference/commandline/build/
args.push("--build-arg", `${key}`)
}
}

if (module.spec.build.targetImage) {
Expand Down

0 comments on commit 33c12eb

Please sign in to comment.