Skip to content

Commit

Permalink
Fixed docker generation for images that use /bin/sh
Browse files Browse the repository at this point in the history
Some images, like debian slim, use the `/bin/sh` which does not provide a
`source` command. This PR replaces `source` with `.`.
  • Loading branch information
cmnrd committed Jun 28, 2024
1 parent 73e8c8a commit 40c49e9
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ protected List<String> getBuildCommands() {
protected List<String> getPreBuildCommand() {
var script = context.getTargetConfig().get(DockerProperty.INSTANCE).preBuildScript();
if (!script.isEmpty()) {
return List.of("source src-gen/" + StringEscapeUtils.escapeXSI(script));
return List.of(". src-gen/" + StringEscapeUtils.escapeXSI(script));
}
return List.of();
}
Expand All @@ -97,7 +97,7 @@ protected List<String> getPreBuildCommand() {
protected List<String> getPostBuildCommand() {
var script = context.getTargetConfig().get(DockerProperty.INSTANCE).postBuildScript();
if (!script.isEmpty()) {
return List.of("source src-gen/" + StringEscapeUtils.escapeXSI(script));
return List.of(". src-gen/" + StringEscapeUtils.escapeXSI(script));
}
return List.of();
}
Expand Down Expand Up @@ -198,7 +198,7 @@ protected final List<String> getEntryPointCommands() {
return List.of(
DockerOptions.DEFAULT_SHELL,
"-c",
"source scripts/"
". scripts/"
+ StringEscapeUtils.escapeXSI(script)
+ " && "
+ entryPoint().stream().collect(Collectors.joining(" ")));
Expand Down

0 comments on commit 40c49e9

Please sign in to comment.