docker-oracle-xe icon indicating copy to clipboard operation
docker-oracle-xe copied to clipboard

Is it possible to move database configuration to the Dockerfile?

Open deusaquilus opened this issue 6 years ago • 1 comments

The ${ORACLE_CMD} configure stage takes a very long time, too long for my CI build to be able to do. I tried moving this step into the Dockerfile which builds the container successfully, but then, attempting to run sqlcmd yields the following error:

> $ORACLE_HOME/bin/sqlplus sys/Oracle18@localhost/XE as sysdba
SQL*Plus: Release 18.0.0.0.0 - Production on Fri Mar 1 08:55:15 2019
Version 18.4.0.0.0

Copyright (c) 1982, 2018, Oracle.  All rights reserved.

ERROR:
ORA-12541: TNS:no listener

Is there any way around this?

deusaquilus avatar Mar 01 '19 08:03 deusaquilus

@deusaquilus Yes, that command takes a while to run. I could think of two options:

  1. Run the container and make sure you have the oradata volume mounted to your host file system. In your CI/CD tool, when you run the container, you should do the same and the "configure" step would be skipped. You'll need to use a the original oradata before each build to have the database in its pristine state.
  2. Comment out the VOLUME instruction before you perform the build. Run the container and then create a Docker image from the running container. I haven't tested this to work, but it might be worth a shot.

fuzziebrain avatar Mar 01 '19 14:03 fuzziebrain