docker-apex-stack icon indicating copy to clipboard operation
docker-apex-stack copied to clipboard

RTU_ENABLED doesn't work as there is no VOLUME statement in dockerfiles

Open ksawerykarwacki opened this issue 4 years ago • 3 comments

As described in the title this snippet doesn't work anymore. I ended up with image without apex and ords started.

`# RTU_ENABLED default 'N'

The following is used for preparing "ready to use" images for internal use only.

if [[ $RTU_ENABLED =~ (Y|y) ]]; then echo "##### Modify target Dockerfile #####" REPLACEMENT_STRING=$'COPY scripts/setup/ $ORACLE_BASE/scripts/setup/\\nCOPY scripts/startup/ $ORACLE_BASE/scripts/startup/\\nCOPY files/ /tmp/files/\\n' sed $SED_OPTS "s|^VOLUME.+$|${REPLACEMENT_STRING}|g" dockerfiles/${DB_VERSION}/${DOCKER_FILE:-Dockerfile} mkdir -p dockerfiles/${DB_VERSION}/files cp $FILES_DIR/$INSTALL_FILE_APEX $FILES_DIR/$INSTALL_FILE_ORDS $FILES_DIR/$INSTALL_FILE_JAVA dockerfiles/${DB_VERSION}/files/ cp -R scripts dockerfiles/${DB_VERSION}/scripts fi`

ksawerykarwacki avatar May 12 '20 07:05 ksawerykarwacki

Thanks. It appears the VOLUME statement was removed a few months ago. I'll work on a fix.

fuzziebrain avatar May 12 '20 13:05 fuzziebrain

Great, I'm looking forward because I really need this feature and reliable way to build images pretty soon (12c lifecycle ends in November, time to start running dev tests and regression on something newer)

ksawerykarwacki avatar May 12 '20 22:05 ksawerykarwacki

For anybody interested, I fixed the RTU with the following diff. Since there's no VOLUME in the Dockerfile I just put the COPY statements before CMD (which should stay as the last command in the Dockerfile). Feel free to use the diff in any way.

diff --git a/01-build.sh b/01-build.sh
index 46003fa..fd555e9 100755
--- a/01-build.sh
+++ b/01-build.sh
@@ -111,9 +111,9 @@ cd $BASE_DIR
 if [[ $RTU_ENABLED =~ (Y|y) ]]; then
   echo "##### Modify target Dockerfile #####"
   REPLACEMENT_STRING=$'COPY scripts/setup/ \$ORACLE_BASE/scripts/setup/\\\nCOPY scripts/startup/ \$ORACLE_BASE/scripts/startup/\\\nCOPY files/ /tmp/files/\\\n'
-  sed $SED_OPTS "s|^VOLUME.+$|${REPLACEMENT_STRING}|g" dockerfiles/${DB_VERSION}/${DOCKER_FILE:-Dockerfile}
+  sed $SED_OPTS "s|^CMD.+$|${REPLACEMENT_STRING}\0|g" dockerfiles/${DB_VERSION}/${DOCKER_FILE:-Dockerfile}
   mkdir -p dockerfiles/${DB_VERSION}/files
   cp $FILES_DIR/$INSTALL_FILE_APEX $FILES_DIR/$INSTALL_FILE_ORDS $FILES_DIR/$INSTALL_FILE_JAVA dockerfiles/${DB_VERSION}/files/
   cp -R scripts dockerfiles/${DB_VERSION}/scripts
 fi

Coffei avatar Oct 17 '22 12:10 Coffei