MaksymBilenko / docker-oracle-12c

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

does not have the required privileges or is invalid #138

Closed cn-sy-yl closed 4 years ago

cn-sy-yl commented 4 years ago

Hello,thank you for your hard work.I use your image to build oracle with commond docker run -d -p 8080:8080 -p 1521:1521 --name oracle -v /home/docker/oradata:/u01/app/oracle quay.io/maksymbilenko/oracle-12c.And then i see the log,the log show me some error like following: `Database not initialized. Initializing database. Starting tnslsnr [FATAL] [DBT-00006] The logging directory could not be created. CAUSE: "/u01/app/oracle/cfgtoollogs/dbca" does not have the required privileges or is invalid. ACTION: Verify path is valid and has the right privileges. SUMMARY:

mightymatth commented 4 years ago

I can confirm the same issue on Ubuntu 18.04 LTS Any fixes or workarounds?

moveurbody commented 4 years ago

you can try to create the volume first docker volume create oracle_data, then add -e DBCA_TOTAL_MEMORY=1024 when you create the container. It works for me.

cooltux008 commented 4 years ago

I found that the oracle process is running with oracle user in image 'quay.io/maksymbilenko/oracle-12c' , like this [oracle@86baa69d4229 ~]$ id uid=1000(oracle) gid=1001(oracle) groups=1001(oracle),1000(dba)

So you need add a user and group in local system(eg, centos7) when using -v args

groupadd -g 1001 oracle groupadd -g 1000 dba useradd -u 1000 oracle -g oracle -G dba mkdir -p /oracle/data chown -R oracle: /oracle/data

docker run --name o12c -d -p 8080:8080 -p 1521:1521 -v /oracle/data:/u01/app/oracle quay.io/maksymbilenko/oracle-12c

This works for me.

MaksymBilenko commented 4 years ago

chown -R 1000:1000 /oracle/data should be enough, not necessary to add oracle user at host system...