MaksymBilenko / docker-oracle-12c

:whale: Docker image with Oracle Database 12c on board
Apache License 2.0
680 stars 285 forks source link

Different behaviour with docker & docker-compose #82

Open adambarreiro opened 6 years ago

adambarreiro commented 6 years ago

Hi @MaksymBilenko,

Fisrt of all thanks a lot for your work, really useful! :) I wanted to ask you a question, I'm quite confused about an issue.

So, it happens that if I run the Docker container and put some SQL files inside docker-entrypoint-initdb.d the SQL files are not executed in alphabetical order, so I'm getting a lot of errors.

If I do exactly the same with docker-compose (same shared volume, same ports, everything) it works. Do you have some clue of what's happening?

Dockerfile is really simple:

FROM sath89/oracle-12c
COPY */*.sql /docker-entrypoint-initdb.d/
EXPOSE 8080 1521

Running with docker run --name=com-oracle-db -d -v db:/u01/app/oracle:rw -p 1527:1521 -p 10000:8080 com-oracle-db:12c-express

docker-compose:

...
  db:
    image: com-oracle-db:12c-express
    container_name: com-oracle-db
    volumes:
     - ./db:/u01/app/oracle:rw
    ports:
     - 1527:1521
     - 10000:8080
    environment:
     - DBCA_TOTAL_MEMORY=1024

One quick solution is putting everything in a single file... but I'd like to have them separated by concern/purpose.

Thanks in advance for reading!