Skip to content

Commit 2973e67

Browse files
author
Tom Barnes
authored
When '--builder' isn't specified, use the WLSIMG_BUILDER env var... (#393)
* When '--builder' isn't specified, use the WLSIMG_BUILDER env var as the build engine (if set). Continue to use 'docker' otherwise.
1 parent 2969fba commit 2973e67

File tree

8 files changed

+15
-9
lines changed

8 files changed

+15
-9
lines changed

documentation/1.11/content/userguide/tools/create-aux-image.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Usage: imagetool createAuxImage [OPTIONS]
2424
| `--tag` | (Required) Tag for the final build image. Example: `store/oracle/mydomain:1` | |
2525
| `--additionalBuildCommands` | Path to a file with additional build commands. For more details, see [Additional information](#--additionalbuildcommands). |
2626
| `--additionalBuildFiles` | Additional files that are required by your `additionalBuildCommands`. A comma separated list of files that should be copied to the build context. See [Additional information](#--additionalbuildfiles). |
27-
| `--builder`, `-b` | Executable to process the Dockerfile. Use the full path of the executable if not on your path. | `docker` |
27+
| `--builder`, `-b` | Executable to process the Dockerfile. Use the full path of the executable if not on your path. | Defaults to `docker`, or, when set, to the value in environment variable `WLSIMG_BUILDER`. |
2828
| `--buildNetwork` | Networking mode for the RUN instructions during the image build. See `--network` for Docker `build`. | |
2929
| `--chown` | `userid:groupid` for JDK/Middleware installs and patches. | `oracle:oracle` |
3030
| `--dryRun` | Skip Docker build execution and print the Dockerfile to stdout. | |

documentation/1.11/content/userguide/tools/create-image.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Usage: imagetool create [OPTIONS]
2121
| `--tag` | (Required) Tag for the final build image. Example: `store/oracle/weblogic:12.2.1.3.0` | |
2222
| `--additionalBuildCommands` | Path to a file with additional build commands. For more details, see [Additional information](#--additionalbuildcommands). |
2323
| `--additionalBuildFiles` | Additional files that are required by your `additionalBuildCommands`. A comma separated list of files that should be copied to the build context. See [Additional information](#--additionalbuildfiles). |
24-
| `--builder`, `-b` | Executable to process the Dockerfile. Use the full path of the executable if not on your path. | `docker` |
24+
| `--builder`, `-b` | Executable to process the Dockerfile. Use the full path of the executable if not on your path. | Defaults to `docker`, or, when set, to the value in environment variable `WLSIMG_BUILDER`. |
2525
| `--buildNetwork` | Networking mode for the RUN instructions during the image build. See `--network` for Docker `build`. | |
2626
| `--chown` | `userid:groupid` for JDK/Middleware installs and patches. | `oracle:oracle` |
2727
| `--docker` | (DEPRECATED) Path to the Docker executable. Use `--builder` instead. | `docker` |

documentation/1.11/content/userguide/tools/inspect-image.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Usage: imagetool inspect [OPTIONS]
1616
| Parameter | Definition | Default |
1717
| --- | --- | --- |
1818
| `--image`, `-i` | (Required) The image ID or image name to be inspected. | |
19-
| `--builder`, `-b` | Executable to process the Dockerfile. Use the full path of the executable if not on your path. | `docker` |
19+
| `--builder`, `-b` | Executable to inspect Docker images. Use the full path of the executable if not on your path. | Defaults to `docker`, or, when set, to the value in environment variable `WLSIMG_BUILDER`. |
2020
| `--format` | The output format. Supported values: `JSON` | `JSON` |
2121
| `--patches` | Include OPatch information in the output, including a list of WebLogic patches that are applied. | |
2222

documentation/1.11/content/userguide/tools/rebase-image.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Usage: imagetool rebase [OPTIONS]
2121
| `--tag` | (Required) Tag for the final build image. Example: `store/oracle/weblogic:12.2.1.3.0` | |
2222
| `--additionalBuildCommands` | Path to a file with additional build commands. For more details, see [Additional information](#--additionalbuildcommands). |
2323
| `--additionalBuildFiles` | Additional files that are required by your `additionalBuildCommands`. A comma separated list of files that should be copied to the build context. See [Additional information](#--additionalbuildfiles). |
24-
| `--builder`, `-b` | Executable to process the Dockerfile. Use the full path of the executable if not on your path. | `docker` |
24+
| `--builder`, `-b` | Executable to process the Dockerfile. Use the full path of the executable if not on your path. | Defaults to `docker`, or, when set, to the value in environment variable `WLSIMG_BUILDER`. |
2525
| `--buildNetwork` | Networking mode for the RUN instructions during the image build. See `--network` for Docker `build`. | |
2626
| `--chown` | `userid:groupid` for JDK/Middleware installs and patches. | `oracle:oracle` |
2727
| `--dryRun` | Skip Docker build execution and print the Dockerfile to stdout. | |

documentation/1.11/content/userguide/tools/update-image.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Update WebLogic Docker image with selected patches
2929
| `--tag` | (Required) Tag for the final build image. Example: `store/oracle/weblogic:12.2.1.3.0` | |
3030
| `--additionalBuildCommands` | Path to a file with additional build commands. For more details, see [Additional information](#--additionalbuildcommands). | |
3131
| `--additionalBuildFiles` | Additional files that are required by your `additionalBuildCommands`. A comma separated list of files that should be copied to the build context. See [Additional information](#--additionalbuildfiles). | |
32-
| `--builder`, `-b` | Executable to process the Dockerfile. Use the full path of the executable if not on your path. | `docker` |
32+
| `--builder`, `-b` | Executable to process the Dockerfile. Use the full path of the executable if not on your path. | Defaults to `docker`, or, when set, to the value in environment variable `WLSIMG_BUILDER`. |
3333
| `--buildNetwork` | Networking mode for the RUN instructions during the image build. See `--network` for Docker `build`. | |
3434
| `--chown` | `userid:groupid` for middleware patches and other operations. | Owner:Group of the Oracle Home |
3535
| `--dryRun` | Skip Docker build execution and print the Dockerfile to stdout. | |

imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/menu/CommonOptions.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,11 @@ public String buildId() {
374374

375375
@Option(
376376
names = {"--builder", "-b"},
377-
description = "Executable to process the Dockerfile. Default: ${DEFAULT-VALUE}."
377+
description = "Executable to process the Dockerfile."
378+
+ " Use the full path of the executable if not on your path."
379+
+ " Defaults to 'docker', or, when set, to the value in environment variable WLSIMG_BUILDER."
378380
)
379-
String buildEngine = "docker";
381+
String buildEngine = Constants.BUILDER_DEFAULT;
380382

381383
@Option(
382384
names = {"--target"},

imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/menu/InspectImage.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import com.oracle.weblogic.imagetool.api.model.CommandResponse;
1313
import com.oracle.weblogic.imagetool.inspect.InspectOutput;
14+
import com.oracle.weblogic.imagetool.util.Constants;
1415
import com.oracle.weblogic.imagetool.util.Utils;
1516
import picocli.CommandLine.Command;
1617
import picocli.CommandLine.Option;
@@ -51,9 +52,11 @@ public CommandResponse call() throws Exception {
5152

5253
@Option(
5354
names = {"--builder", "-b"},
54-
description = "Executable to inspect docker images. Default: ${DEFAULT-VALUE}"
55+
description = "Executable to inspect docker images."
56+
+ " Use the full path of the executable if not on your path."
57+
+ " Defaults to 'docker', or, when set, to the value in environment variable WLSIMG_BUILDER."
5558
)
56-
String buildEngine = "docker";
59+
String buildEngine = Constants.BUILDER_DEFAULT;
5760

5861
@Option(
5962
names = {"--patches"},

imagetool/src/main/java/com/oracle/weblogic/imagetool/util/Constants.java

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public final class Constants {
2929
public static final String BUSYBOX = "busybox";
3030
public static final List<String> BUSYBOX_OS_IDS = Collections.unmodifiableList(Arrays.asList("bb", "alpine"));
3131
public static final String ORACLE_LINUX = "ghcr.io/oracle/oraclelinux:8-slim";
32+
public static final String BUILDER_DEFAULT = Utils.getEnvironmentProperty("WLSIMG_BUILDER", "docker");
3233

3334
private Constants() {
3435
//restrict access

0 commit comments

Comments
 (0)