diff --git a/bug_release.sh b/bug_release.sh
index de4440aa..6bdc4766 100755
--- a/bug_release.sh
+++ b/bug_release.sh
@@ -1,4 +1,7 @@
#!/bin/bash
+# Only use this script when releasing bug fixes (removes SNAPSHOT for version)
+set -e
+git checkout main
project_version=$(mvn help:evaluate -q -DforceStdout -D"expression=project.version")
echo Current POM version: ${project_version}
@@ -10,18 +13,18 @@ new_version=$(echo $project_version | sed -e "s/[0-9][0-9]*\([^0-9]*\)$/$next_di
echo New Version: ${new_version}
-echo mvn versions:set -DremoveSnapshot -DgenerateBackupPoms=false
-echo mvn clean install
-echo git add .
-echo git commit -m \"release ${project_version_number_only}\"
-echo git push
+mvn versions:set -DremoveSnapshot -DgenerateBackupPoms=false
+mvn clean install
+git add .
+git commit -m "release ${project_version_number_only}"
+git push
-echo git tag release-${project_version_number_only}
-echo git push origin release-${project_version_number_only}
+git tag release-${project_version_number_only}
+git push origin release-${project_version_number_only}
-echo mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${new_version}
-echo mvn clean install
-echo git add .
-echo git commit -m \"preparing for next development iteration\"
-echo git push
+mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${new_version}
+mvn clean install
+git add .
+git commit -m "preparing for next development iteration"
+git push
diff --git a/documentation/site/content/userguide/tools/create-image.md b/documentation/site/content/userguide/tools/create-image.md
index 68a1f5ae..e14ebe58 100644
--- a/documentation/site/content/userguide/tools/create-image.md
+++ b/documentation/site/content/userguide/tools/create-image.md
@@ -48,6 +48,7 @@ Usage: imagetool create [OPTIONS]
| `--strictPatchOrdering` | Instruct OPatch to apply patches one at a time (uses `apply` instead of `napply`). | |
| `--target` | Select the target environment in which the created image will be used. Supported values: `Default` (Docker/Kubernetes), `OpenShift`. See [Additional information](#--target). | `Default` |
| `--type` | Installer type. Supported values: `WLS`, `WLSDEV`, `WLSSLIM`, `FMW`, `IDM`, `MFT`, `OAM`, `ODI`, `OHS`, `OIG`, `OUD`, `OUD_WLS`, `OID`, `OSB`, `SOA`, `SOA_OSB`, `SOA_OSB_B2B`, `WCC`, `WCP`, `WCS` | `WLS` |
+| `--useBuildx` | Use BuildKit for building the container image. | |
| `--user` | Oracle support email ID. When supplying `user`, you must supply the password either as an environment variable using `--passwordEnv`, or as a file using `--passwordFile`, or interactively, on the command line with `--password`. | |
| `--version` | Installer version. | `12.2.1.3.0` |
| `--wdtArchive` | A WDT archive ZIP file or comma-separated list of files. | |
diff --git a/documentation/site/content/userguide/tools/rebase-image.md b/documentation/site/content/userguide/tools/rebase-image.md
index 25f7fd54..a4cf080d 100644
--- a/documentation/site/content/userguide/tools/rebase-image.md
+++ b/documentation/site/content/userguide/tools/rebase-image.md
@@ -47,6 +47,7 @@ Usage: imagetool rebase [OPTIONS]
| `--target` | Select the target environment in which the created image will be used. Supported values: `Default` (Docker/Kubernetes), `OpenShift`. See [Additional information](#--target). | `Default` |
| `--targetImage` | Container image to extend for the domain's new image. | |
| `--type` | Installer type. Supported values: `WLS`, `WLSDEV`, `WLSSLIM`, `FMW`, `IDM`, `MFT`, `OAM`, `ODI`, `OHS`, `OIG`, `OUD`, `OUD_WLS`, `OID`, `OSB`, `SOA`, `SOA_OSB`, `SOA_OSB_B2B`, `WCC`, `WCP`, `WCS` | `WLS` |
+| `--useBuildx` | Use BuildKit for building the container image. | |
| `--user` | Your Oracle support email ID. When supplying `user`, you must supply the password either as an environment variable using `--passwordEnv`, or as a file using `--passwordFile`, or interactively, on the command line with `--password`. | |
| `--version` | Installer version. | `12.2.1.3.0` |
diff --git a/documentation/site/content/userguide/tools/update-image.md b/documentation/site/content/userguide/tools/update-image.md
index e634b182..a2c06157 100644
--- a/documentation/site/content/userguide/tools/update-image.md
+++ b/documentation/site/content/userguide/tools/update-image.md
@@ -49,6 +49,7 @@ Update WebLogic Docker image with selected patches
| `--strictPatchOrdering` | Instruct OPatch to apply patches one at a time (uses `apply` instead of `napply`). | |
| `--target` | Select the target environment in which the created image will be used. Supported values: `Default` (Docker/Kubernetes), `OpenShift`. See [Additional information](#--target). | `Default` |
| `--type` | Installer type. Supported values: `WLS`, `WLSDEV`, `WLSSLIM`, `FMW`, `IDM`, `MFT`, `OAM`, `ODI`, `OHS`, `OIG`, `OUD`, `OUD_WLS`, `OID`, `OSB`, `SOA`, `SOA_OSB`, `SOA_OSB_B2B`, `WCC`, `WCP`, `WCS` | `WLS` |
+| `--useBuildx` | Use BuildKit for building the container image. | |
| `--user` | Oracle support email ID. When supplying `user`, you must supply the password either as an environment variable using `--passwordEnv`, or as a file using `--passwordFile`, or interactively, on the command line with `--password`. | |
| `--wdtArchive` | A WDT archive ZIP file or comma-separated list of files. | |
| `--wdtDomainHome` | Path to the `-domain_home` for WDT. | `/u01/domains/base_domain` |
diff --git a/imagetool/pom.xml b/imagetool/pom.xml
index e92a08ab..6d543ff0 100644
--- a/imagetool/pom.xml
+++ b/imagetool/pom.xml
@@ -13,7 +13,7 @@
imagetool-parent
com.oracle.weblogic.lifecycle.imagetool
- 1.14.3
+ 1.14.4
../pom.xml
diff --git a/imagetool/src/main/java/com/oracle/weblogic/imagetool/builder/BuildCommand.java b/imagetool/src/main/java/com/oracle/weblogic/imagetool/builder/BuildCommand.java
index fa55d133..b5e39821 100644
--- a/imagetool/src/main/java/com/oracle/weblogic/imagetool/builder/BuildCommand.java
+++ b/imagetool/src/main/java/com/oracle/weblogic/imagetool/builder/BuildCommand.java
@@ -60,6 +60,18 @@ public BuildCommand tag(String value) {
return this;
}
+ /**
+ * Toggle the use of the BuildKit.
+ * If true, the build command will start "buildx build".
+ * If false, the build command will start "build".
+ * @param value true to enable buildx
+ * @return this
+ */
+ public BuildCommand useBuildx(boolean value) {
+ useBuildx = value;
+ return this;
+ }
+
/**
* Add container build platform. Pass the desired
* build architecture to the build process.
@@ -72,7 +84,7 @@ public BuildCommand platform(String value) {
}
command.add("--platform");
command.add(value);
- useBuildx = true;
+ useBuildx(true);
return this;
}
@@ -83,7 +95,8 @@ public BuildCommand platform(String value) {
* @return this
*/
public BuildCommand forceRm(boolean value) {
- if (value) {
+ // Docker removed --force-rm from the buildx build API, and Podman defaults --force-rm=true
+ if (value && !useBuildx) {
command.add("--force-rm");
}
return this;
diff --git a/imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/menu/CommonOptions.java b/imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/menu/CommonOptions.java
index af6bddc9..63eaae58 100644
--- a/imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/menu/CommonOptions.java
+++ b/imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/menu/CommonOptions.java
@@ -121,9 +121,10 @@ BuildCommand getInitialBuildCmd(String contextFolder) {
logger.entering();
BuildCommand cmdBuilder = new BuildCommand(buildEngine, contextFolder);
- cmdBuilder.forceRm(!skipcleanup)
- .tag(imageTag)
+ cmdBuilder.tag(imageTag)
+ .useBuildx(useBuildx)
.platform(buildPlatform)
+ .forceRm(!skipcleanup)
.network(buildNetwork)
.pull(buildPull)
.additionalOptions(buildOptions)
@@ -450,6 +451,12 @@ public Architecture getTargetArchitecture() {
)
private String buildPlatform;
+ @Option(
+ names = {"--useBuildx"},
+ description = "Use the BuildKit for building the container image (default when building multi-architecture)"
+ )
+ private boolean useBuildx;
+
@Parameters(
description = "Container build options.",
hidden = true
diff --git a/imagetool/src/main/resources/docker-files/install-middleware.mustache b/imagetool/src/main/resources/docker-files/install-middleware.mustache
index 1beccc6a..a20961fc 100644
--- a/imagetool/src/main/resources/docker-files/install-middleware.mustache
+++ b/imagetool/src/main/resources/docker-files/install-middleware.mustache
@@ -21,10 +21,10 @@ RUN mkdir -p {{{oracle_home}}} \
&& chown {{userid}}:{{groupid}} {{orainv_dir}} \
&& chown {{userid}}:{{groupid}} {{{oracle_home}}}
-{{#installJava}}COPY --from=jdk_build --chown={{userid}}:{{groupid}} {{{java_home}}} {{{java_home}}}/
+{{#installJava}}COPY --from=jdk_build --chown={{userid}}:{{groupid}} ["{{{java_home}}}", "{{{java_home}}}/"]
{{/installJava}}
-{{#installPackages}}COPY --chown={{userid}}:{{groupid}} {{installerFilename}} {{responseFile.name}} {{{tempDir}}}/{{{type}}}/
+{{#installPackages}}COPY --chown={{userid}}:{{groupid}} ["{{installerFilename}}", "{{responseFile.name}}", "{{{tempDir}}}/{{{type}}}/"]
{{/installPackages}}
COPY --chown={{userid}}:{{groupid}} oraInst.loc {{inv_loc}}/
@@ -38,7 +38,7 @@ RUN echo "INSTALLING MIDDLEWARE" \
{{#installPackages}}
&& echo "INSTALLING {{type}}" \
# If installer is packaged in a ZIP, extract it before running it
- {{#isZip}}&& unzip -q {{{tempDir}}}/{{{type}}}/{{installerFilename}} -d {{{tempDir}}}/{{{type}}} {{/isZip}} \
+ {{#isZip}}&& unzip -q "{{{tempDir}}}/{{{type}}}/{{installerFilename}}" -d {{{tempDir}}}/{{{type}}} {{/isZip}} \
{{#preinstallCommands}}&& {{{tempDir}}}/{{{type}}}/{{{.}}} {{/preinstallCommands}} \
# IF the installer is a JAR file (not a .bin), run the silent install using Java
{{^isBin}} && {{{java_home}}}/bin/java -Xmx1024m -jar {{{tempDir}}}/{{{type}}}/{{jarName}} \
diff --git a/imagetool/src/test/java/com/oracle/weblogic/imagetool/builder/BuilderTest.java b/imagetool/src/test/java/com/oracle/weblogic/imagetool/builder/BuilderTest.java
index bfd029ce..42893212 100644
--- a/imagetool/src/test/java/com/oracle/weblogic/imagetool/builder/BuilderTest.java
+++ b/imagetool/src/test/java/com/oracle/weblogic/imagetool/builder/BuilderTest.java
@@ -79,4 +79,25 @@ void testBuildWithProxyPass() {
cmd.tag("img:3").buildArg("http_proxy", "http://user:pass@blah/blah", true);
assertEquals(expected("--tag img:3 --build-arg http_proxy=********"), cmd.toString());
}
+
+ @Test
+ void testBuildArgsWithPlatform() {
+ Map argMap = null;
+
+ BuildCommand cmd = new BuildCommand(BUILD_ENGINE, BUILD_CONTEXT)
+ .tag("img:4")
+ .pull(true)
+ .platform("linux/amd64")
+ .forceRm(true)
+ .network("private-net")
+ .buildArg(argMap);
+
+ // expect that "--force-rm" will not be used, expect "buildx build" will be used
+ assertEquals(
+ String.format("%s buildx build %s %s",
+ BUILD_ENGINE,
+ "--tag img:4 --pull --platform linux/amd64 --network private-net",
+ BUILD_CONTEXT),
+ cmd.toString());
+ }
}
diff --git a/installer/pom.xml b/installer/pom.xml
index f8193a67..46260a22 100644
--- a/installer/pom.xml
+++ b/installer/pom.xml
@@ -13,7 +13,7 @@
imagetool-parent
com.oracle.weblogic.lifecycle.imagetool
- 1.14.3
+ 1.14.4
../pom.xml
diff --git a/pom.xml b/pom.xml
index 57936cc4..485c44cf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -8,7 +8,7 @@
4.0.0
com.oracle.weblogic.lifecycle.imagetool
imagetool-parent
- 1.14.3
+ 1.14.4
pom
WebLogic Image Tool
@@ -72,7 +72,7 @@
org.junit.jupiter
junit-jupiter-engine
- 5.11.3
+ 5.11.4
test
@@ -154,7 +154,7 @@
org.apache.maven.plugins
maven-failsafe-plugin
- 3.5.0
+ 3.5.2
${test.groups}
failing
@@ -214,7 +214,7 @@
org.apache.maven.plugins
maven-checkstyle-plugin
- 3.5.0
+ 3.6.0
checkstyle
@@ -242,14 +242,14 @@
com.puppycrawl.tools
checkstyle
- 10.20.2
+ 10.21.1
org.apache.maven.plugins
maven-surefire-plugin
- 3.5.1
+ 3.5.2
unit
failing
@@ -281,7 +281,7 @@
org.sonarsource.scanner.maven
sonar-maven-plugin
- 4.0.0.4121
+ 5.0.0.4389
org.apache.maven.plugins
diff --git a/tests/pom.xml b/tests/pom.xml
index 23d78a39..c8a8adaf 100644
--- a/tests/pom.xml
+++ b/tests/pom.xml
@@ -12,7 +12,7 @@
imagetool-parent
com.oracle.weblogic.lifecycle.imagetool
- 1.14.3
+ 1.14.4
../pom.xml
diff --git a/tests/src/test/java/com/oracle/weblogic/imagetool/tests/utils/Runner.java b/tests/src/test/java/com/oracle/weblogic/imagetool/tests/utils/Runner.java
index 80070410..d9d89e23 100644
--- a/tests/src/test/java/com/oracle/weblogic/imagetool/tests/utils/Runner.java
+++ b/tests/src/test/java/com/oracle/weblogic/imagetool/tests/utils/Runner.java
@@ -68,12 +68,13 @@ public static CommandResult run(String command, PrintWriter output) throws IOExc
p = pb.start();
- BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream(), UTF_8));
StringBuilder processOut = new StringBuilder();
- String line;
- while ((line = reader.readLine()) != null) {
- processOut.append(line);
- output.println(line);
+ try (BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream(), UTF_8))) {
+ String line;
+ while ((line = reader.readLine()) != null) {
+ processOut.append(line);
+ output.println(line);
+ }
}
p.waitFor();