How to run multiple containers using the same Oracle-DB image?

I pulled a new Oracle-DB image using the following command: docker pull container-registry.oracle.com/database/enterprise:12.2.0.1

And then ran the 1st container successfully. I’m using the default database that has been created by the docker/oracle container and I can connect to it from the application that I’m running in localhost.

Now, I’m trying to run the 2nd container using same image I used above with the following command: docker run -itd --name Oracle-DB-2 -P store/oracle/database-enterprise:12.2.0.1 The container has been created and I executed the following command in order to run a few maintenance scripts from sqlplus: docker exec -it Oracle-DB-2 bash -c "source /home/oracle/.bashrc; sqlplus sys/Oradoc_db1@ORCLCDB as sysdba"

I’m getting the below error message upon executing the above command: sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory

To diagnose the issue, I logged into the 1st container and checked where the file, libsqlplus.so exists and found it is in: ./u01/app/oracle/product/12.2.0/dbhome_1/lib/libsqlplus.so

However, above file is not found in the 2nd container. I’m new to docker and wondering if I’m running it correctly, particularly when it comes to running multiple containers using the same image. How can I fix the above issue? Appreciate any thoughts.

This is how my env looks like:
macOS Big Sure
Docker Desktop 4.1.0

I am trying to do the same, were you able to figure this out?

There is nothing special about running multiple containers from the same image. The image just a template. You can run as many containers from an image as you want. As long as you have enough resources to run all of them. If you use the same image, you will get the same files. The only difference can be what the container does after starting it. If the missing file is copied to its location after starting the container, then maybe the container failed before the copy could happen, but somehow it continued to run so the container did not stop.

I have run multiple oracle containers on the same machine without any problem, although it was years ago and it was not the enterprise version.

Try to get the logs

docker logs containername