Skip to content

Commit 046131a

Browse files
authored
Merge branch 'master' into java-home-update-image
2 parents 72bc042 + 3c1f2bc commit 046131a

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ public CommandResponse call() throws Exception {
8181

8282
String opatchVersion = baseImageProperties.getProperty("OPATCH_VERSION");
8383

84+
String baseImageUsr = baseImageProperties.getProperty("ORACLE_HOME_USER");
85+
String baseImageGrp = baseImageProperties.getProperty("ORACLE_HOME_GROUP");
86+
if (!dockerfileOptions.userid().equals(baseImageUsr) || !dockerfileOptions.groupid().equals(baseImageGrp)) {
87+
return new CommandResponse(-1, "IMG-0087", fromImage, baseImageUsr, baseImageGrp);
88+
}
89+
8490
String lsinventoryText = null;
8591

8692
if (applyingPatches()) {

imagetool/src/main/resources/ImageTool.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,5 @@ IMG-0082=Failed to determine release number for product {0}, version {1}
8484
IMG-0083=Version {0} for patch ID {1} was not found in the available versions: {2}
8585
IMG-0084=No recommended patches found for {0}
8686
IMG-0085=The recommended ADR patch was skipped for the WLS installer, use --patch {0} to apply this patch
87-
IMG-0086=Failed to find patch number [[brightred: {0}]] on Oracle servers, verify the patch number is correct using My Oracle Support.
87+
IMG-0086=Failed to find patch number [[brightred: {0}]] on Oracle servers, verify the patch number is correct using My Oracle Support.
88+
IMG-0087=The Oracle Home directory in --fromImage={0} has an owner and group of {1}:{2}. You must update the image with the same user and group setting from when it was created. Example: --chown={1}:{2}

imagetool/src/main/resources/probe-env/test-update-env.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ if [[ -n "$ORACLE_HOME" ]]; then
4343
echo OPATCH_VERSION="$("$ORACLE_HOME"/OPatch/opatch version 2> /dev/null | grep -oE -m 1 '([[:digit:]\.]+)')"
4444
"$ORACLE_HOME"/OPatch/opatch lsinventory > /tmp/lsout 2> /dev/null
4545

46+
echo ORACLE_HOME_USER="$(stat -c '%U' "$ORACLE_HOME")"
47+
echo ORACLE_HOME_GROUP="$(stat -c '%G' "$ORACLE_HOME")"
48+
4649
if [[ -f "/tmp/lsout" ]]; then
4750
echo LSINV_TEXT="$(base64 -w 0 /tmp/lsout)"
4851
fi

0 commit comments

Comments
 (0)