2

I am using Docker (Community edition, Version 17.09.1-ce-mac42 (21090), 3176a6af01). For webapp development, I need Oracle 12c (and I need saving my works (database table, view, data, etc.) after close Docker application), therefore I use https://github.com/MaksymBilenko/docker-oracle-12c

I do these steps

sudo docker pull sath89/oracle-12c
sudo mkdir -p /Users/donhuvy/Documents/oracle12c_data
sudo docker run -d -p 8080:8080 -p 1521:1521 -v /Users/donhuvy/Documents/oracle12c_data:/u01/app/oracle -e DBCA_TOTAL_MEMORY=2048 sath89/oracle-12c

Result

eccdc90353d36e85f08597dea894da332a29024d88c3e80d20894540029667d4

then

docker logs -f eccdc90353d36e85f08597dea894da332a29024d88c3e80d20894540029667d4

I see this error:

chown: changing ownership of '/u01/app/oracle': Operation not permitted

enter image description here

What is the cause and how to avoid the error?

eLRuLL
  • 18,488
  • 9
  • 73
  • 99
Vy Do
  • 46,709
  • 59
  • 215
  • 313
  • Why `close(1)`? – Vy Do Dec 29 '17 at 14:22
  • 1
    Does any of the following work: 1. Try running the container without the `-v` option. 2. Try starting the container with `-v` option and `--user root` – yamenk Dec 29 '17 at 14:24
  • When I run `docker run -d -p 8080:8080 -p 1521:1521 /Users/donhuvy/Documents/oracle12c_data:/u01/app/oracle -e DBCA_TOTAL_MEMORY=2048 sath89/oracle-12c` I see `docker: invalid reference format: repository name must be lowercase. See 'docker run --help'.` – Vy Do Dec 29 '17 at 14:26
  • Remove `/Users/donhuvy/Documents/oracle12c_data:/u01/app/oracle` this is the value of `-v` option. – yamenk Dec 29 '17 at 14:26
  • When I run `docker run -d -p 8080:8080 -p 1521:1521 -e DBCA_TOTAL_MEMORY=2048 sath89/oracle-12c` It works, but I need few minutes to test saving my works (create database, turn off Docker, re-open, and check existing my works). Seemly, your comment is not ultimate solution. I need saving my works in Docker images/container after close Docker. I can run it success, but I want save my job after close Docker. – Vy Do Dec 29 '17 at 14:28
  • @yamenk , I must save data after work. Without option `-v`, when I close Docker, I can't save database schema, data what I created. Let's see user manual: https://github.com/MaksymBilenko/docker-oracle-12c#installation section ***Run with data on host and reuse it*** – Vy Do Dec 29 '17 at 14:40
  • Looks like the close voter thinks this is off-topic because it's about server/infrastructure administration – APC Dec 29 '17 at 14:41
  • @DoNhuVy What about `docker run -u root ...` option. Does it work? – yamenk Dec 29 '17 at 14:48
  • When I run `docker run -d -p 8080:8080 -p 1521:1521 -u root -v /Users/donhuvy/Documents/oracle12c_data:/u01/app/oracle -e DBCA_TOTAL_MEMORY=2048 sath89/oracle-12c` I see `chown: changing ownership of '/u01/app/oracle': Operation not permitted`. – Vy Do Dec 29 '17 at 14:50
  • Have you considered raising this issue with [Maksym?](https://github.com/MaksymBilenko/docker-oracle-12c/issues?q=is%3Aissue+is%3Aopen) – APC Dec 29 '17 at 14:52
  • I just ask him via email, and I am waiting. – Vy Do Dec 29 '17 at 14:52
  • Seemly this is the cause: https://support.apple.com/en-vn/HT204899 A solution: https://stackoverflow.com/a/32661637/3728901 but It is dangerous. I am looking for another solution. – Vy Do Dec 29 '17 at 15:56
  • See [**Running Oracle 12c EE in Docker container**](https://lalitkumarb.wordpress.com/2017/12/29/docker-oracle-12c-ee-on-ol7/) – Lalit Kumar B Mar 05 '18 at 07:01

1 Answers1

0

On macOS 10.13.1 High Sierra with Docker Community Edition version 17.09.1-ce-mac42 (21090) 3176a6af01, do these steps:

sudo docker pull sath89/oracle-12c
sudo mkdir -p /Users/donhuvy/Documents/oracle12c_data
sudo mkdir -p /u01/app/oracle

To avoid error

chown: changing ownership of '/u01/app/oracle': Operation not permitted

Use Finder, go to directory /Users/donhuvy/Documents/oracle12c_data, Right click, choose context menu Get info, see at the bottom right corner, you will see a lock icon, click the icon, enter your administration password. Then set permission Read & Write for everyone

enter image description here

Do the same thing with directory /u01/app/oracle

Then run

sudo docker run -d -p 8080:8080 -p 1521:1521 -v /Users/donhuvy/Documents/oracle12c_data:/u01/app/oracle -e DBCA_TOTAL_MEMORY=2048 sath89/oracle-12c

After you worked, if you want pause/stop your work, turn off Docker. When you turn on Docker, return previous works, all things are still exist.

Vy Do
  • 46,709
  • 59
  • 215
  • 313