docker-oracle-xe
docker-oracle-xe copied to clipboard
Is it possible to move database configuration to the Dockerfile?
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 Yes, that command takes a while to run. I could think of two options:
- Run the container and make sure you have the
oradatavolume 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 originaloradatabefore each build to have the database in its pristine state. - Comment out the
VOLUMEinstruction 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.