0

i just want to start an oracle docker container with docker-compose.yml.
that works so far, till i added a folder to sync/mount/whatever from the container.

problem 1: if the folder on the host is missing - docker doesn't mount anything
problem 2: a empty folder is getting ignored by git - so i added an empty file .emptyfileforgit

So if i now start my docker-compose up, docker mounts the folder with my fake file to the oracle container, and so the database is "broken".

docker compose file:

version: "3"
services:
mysql_db:
container_name: oracle_db
image: wnameless/oracle-xe-11g:latest
ports:
- "49160:22"
- "49161:1521"
- "49162:8080"
restart: always
volumes:
- "./oracle_data:/u01/app/oracle/oradata"
- "./startup_scripts:/docker-entrypoint-initdb.d"
environment:
- ORACLE_ALLOW_REMOTE=true

Question: how can i get rid of this behaviour?
With a mysql container that works fine...

Thanks a lot!

2 Answers 2

0

By using volume , folder/path/in/host : folder/path/in/container , the data in the container folder is mapped to provided location in the host. Initially the db data is empty, that is why your host folder does not contain any data. And do not put mock-invalid data in the db folder in your container. Because it will corrupt your db. If you want to add dump db data, just put it in the folder of your host folder, it will mapped to the path in your container

Sign up to request clarification or add additional context in comments.

1 Comment

hmm no - initially the db data isn't empty. if i start the container without - "./oracle_data:/u01/app/oracle/oradata"then the folder /u01/app/oracle/oradata is filled with the database (folder XE with the .dbf files) - i think that should be the normal way? but now the question is, how get i mounted these data out of the docker container.
0

You need to copy files in /0u1/app/oracle/oradata then you can access it out of container in your system in path ./orcle_data location.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.