-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when mounting volume #17
Comments
That's quite interesting. Just checking, your docker-compose.yml looks the same as in this repo, except diff --git a/docker-compose.yml b/docker-compose.yml
index bbe50fd..4057d48 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -30,7 +30,8 @@ services:
- INSTALL_YEAST_DATA=0
- PGDATA=/var/lib/postgresql/data/
volumes:
- - /var/lib/postgresql/data/
+ - /home/hxr/work/docker-chado/test:/var/lib/postgresql/data/:rw
+ #- /var/lib/postgresql/data/
elasticsearch:
image: elasticsearch Or no? With that change even, I can bring up the container without issue. For a simpler test, this works as well for me. $ docker run -itP -v /home/hxr/work/docker-chado/test:/var/lib/postgresql/data/:rw erasche/chado:1.31-jenkins97-pg9.5 The chown that's happening is probably https://github.com/docker-library/postgres/blob/master/9.5/docker-entrypoint.sh#L33, are you starting it with --user or anything? Sorry I'm not more help / this is so many bugs. |
Thanks for getting back to me so quickly. |
yes! exactly. If the simple version fails.. gosh. Maybe the image got updated?
sha256 in case you need to confirm. Hmm. I'm guessing you found the selinux stuff from here or so docker-library/postgres#116. Does the Maybe the other selinux chcon stuff? Or try wiping out the directory and re-running the container? Sorry I'm not able to be more helpful |
Thanks, Eric. The image is up to date with sha256.
Yes I've tried suggestions from those links. I tried the However, I was able to bring up a working instance (with mounted volume) on another box where my user (call it "myhostuser") is a sudo-er. I notice that the data directory on my host changed ownership from "myhostuser.myhostuser" to "guest-c1aswz.myhostuser" with subdirectories written by Postgres with ownership "guest-c1aswz.docker". From my host machine, I needed to use sudo to access, read and write to the modified data directory. (Is this normal?) I'm still not sure why it doesn't work on that other machine. I'll update you if I find a solution to it. 😄 Thanks again! |
Thanks for the update @ehsueh! Interesting, very interesting that you have to be a sudoer. I wonder why that is. Yes, normal to have to Please do update if you find out! :) |
Hi again,
I'm experiencing an error when I try to mount a volume for the postgres db by changing the "volumes" section of docker-compose.yml for db to:
volumes: - /absolute/path/to/data/on/host:/var/lib/postgresql/data/:rw
When I try to run
docker-compose up db
I get:At first I thought maybe it's due to permission or configuration issues on my host machine, so I tried looking into selinux but with no success. When I created a simplified container building from erasche/chado:1.31-jenkins97-pg9.5, I was able to mount a host data directory on /foo and read and write smoothly through /foo to the directory on host. However, if I mount the same host data directory to the same container but on /var/lib/postgresql/data (instead of /foo), the build crashes. 😖
Do you know what might be the problem? What could I try to trace the problem further?
Thank you for your time. 😄
The text was updated successfully, but these errors were encountered: