2018-04-13

Solving the "file too large" issue for oracle 12c db docker image

Prerequisites:

The challenge was to install a docker image with Oracle 12.2.0.1 Database Standard Edition to a OEL 7 server. The following prerequisites were set:
  • OEL 7.4
  • DOCKER 17.12
  • Openshift Origin v3-latest
For the Openshift cluster, the docker storage-type was set to 'overlay2' (which is the recommended setting). Construction of the image has been done via README.md given by

Oracle official Docker-Images

Issue:

Running through the issue, the following exception occured on step 7/17 of the Dockerfile:
chown: changing ownership of '/opt/oracle/install/linuxx64_12201_database.zip': File too large
Removing intermediate container d581497c401d
The command '/bin/sh -c chmod ug+x $INSTALL_DIR/*.sh && sync && 
$INSTALL_DIR/$CHECK_SPACE_FILE && $INSTALL_DIR/$SETUP_LINUX_FILE' returned a non-zero code: 1

Solution:

There seems to be an issue with the storage-type overlay2 and large files on OEL. Thus the first idea was to change the storage-type from 'overlay2' to 'devicemapper'. But this is not recommended for production-like environments. A more serious issue was that the openshift cluster was not able to start up anymore after changing the docker storage type.

Thus we tried another approach. Sometimes Docker locks up files (for chowning) that were introduced via COPY task in previous steps of the Dockerfile. A common workaround for this issue is to make a copy of an issued file, removing the original, doing the chown and moving the copy back to the original. This approach worked in this case. The problematic command can be found in the file

<Dockerfile-Home>/<Version_of_DB>/setupLinuxEnv.sh
change the line
chown -R oracle:dba $ORACLE_BASE
to 
cp $ORACLE_BASE/install/linuxx64_12201_database.zip $ORACLE_BASE/install/rename.zip
rm $ORACLE_BASE/install/linuxx64_12201_database.zip
chown -R oracle:dba $ORACLE_BASE
mv $ORACLE_BASE/install/rename.zip $ORACLE_BASE/install/linuxx64_12201_database.zip
This solves the issue and the docker build should run through.
Cheers!

Keine Kommentare:

Kommentar veröffentlichen