Skip to content

Commit

Permalink
Bugfix docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
andrejpetras committed Nov 18, 2019
1 parent 8989ec1 commit 7965120
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/main/java/org/lorislab/samo/DockerCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,21 @@ public static class Build extends CommonCommand {
@CommandLine.Option(
names = {"-d", "--dockerfile"},
paramLabel = "DOCKERFILE",
defaultValue = ".",
required = true,
description = "the docker file"
)
String dockerfile;

/**
* The docker repository
*/
@CommandLine.Option(
names = {"-c", "--context"},
paramLabel = "CONTEXT",
required = true,
defaultValue = ".",
description = "the docker build context"
)
String context;

/**
* Verbose flag.
Expand Down Expand Up @@ -222,7 +231,10 @@ public Integer call() throws Exception {
sb.append(" -t ").append(branchTag);
log.append(",").append(branchTag);
}
sb.append(" ").append(dockerfile);
if (dockerfile != null && !dockerfile.isEmpty()) {
sb.append(" -f ").append(dockerfile);
}
sb.append(" ").append(context);
log.append("]");

// execute the docker commands
Expand Down

0 comments on commit 7965120

Please sign in to comment.