Giter VIP home page Giter VIP logo

Comments (9)

DomiStyle avatar DomiStyle commented on July 30, 2024

That's strange. Can you post the output of docker-compose exec eldewrito ls -la /game?

from docker-eldewrito.

amrelk avatar amrelk commented on July 30, 2024

It says it can't access it, permission denied. I've tried chowning it to dew and to root.

from docker-eldewrito.

DomiStyle avatar DomiStyle commented on July 30, 2024

root is accessing the files by default inside of the container, if root can't access it something is wrong with the game folder or the way it is mounted in Docker.

from docker-eldewrito.

amrelk avatar amrelk commented on July 30, 2024

Here is the output of docker-compose exec eldewrito ls -la /

total 8
drwxr-xr-x.   1 root root   17 May 16 14:25 .
drwxr-xr-x.   1 root root   17 May 16 14:25 ..
-rwxr-xr-x.   1 root root    0 May 16 14:25 .dockerenv
drwxr-xr-x.   1 root root   26 May  1 19:59 bin
drwxr-xr-x.   2 root root    6 Apr 12  2016 boot
drwxrwxrwx.   2 1001 1001    6 May 15 20:54 config
drwxr-xr-x.   2 root root   67 May  1 20:03 defaults
drwxr-xr-x.   5 root root  340 May 16 14:25 dev
drwxr-xr-x.   1 root root   66 May 16 14:25 etc
drwxrwxrwx.   5 1001 1001 4096 May 15 22:39 game
drwxr-xr-x.   2 root root    6 Apr 12  2016 home
drwxr-xr-x.   1 root root   73 May  1 19:59 lib
drwxr-xr-x.   2 root root   34 Apr 17 13:40 lib64
drwxrwxrwx.   2 1001 1001    6 May 15 20:54 logs
drwxr-xr-x.   2 root root    6 Apr 17 13:40 media
drwxr-xr-x.   2 root root    6 Apr 17 13:40 mnt
drwxr-xr-x.   1 root root   26 May  1 19:56 opt
dr-xr-xr-x. 176 root root    0 May 16 14:25 proc
drwx------.   1 root root   67 May  1 20:00 root
drwxr-xr-x.   1 root root   21 May 16 14:25 run
drwxr-xr-x.   1 root root  159 May  1 19:59 sbin
drwxr-xr-x.   2 root root    6 Apr 17 13:40 srv
-rwxr-xr-x.   1 root root 3995 May  1 19:50 start.sh
dr-xr-xr-x.  13 root root    0 May  3 21:42 sys
drwxrwxrwt.   1 root root    6 May  1 20:03 tmp
drwxr-xr-x.   1 root root   41 May  1 20:03 usr
drwxr-xr-x.   1 root root   41 May  1 20:03 var
drwxr-xr-x.   4 root root  139 May  1 20:00 wine

the config, game, and logs folders are owned by a user named 1001, is that a problem?

from docker-eldewrito.

DomiStyle avatar DomiStyle commented on July 30, 2024

Yes, that is a problem. The Docker container will chown the game directory on startup and it seems like it's not able to do so.

Maybe try running a simple alpine image with the game folder as volume and see if you can see the game folder that way?

For example:

docker run -it --rm -v /home/dew/game:/game alpine ls -la /game

from docker-eldewrito.

amrelk avatar amrelk commented on July 30, 2024

same problem:

[root@hostname dew]# docker run -it --rm -v /home/dew/game:/game alpine ls -la /game
Unable to find image 'alpine:latest' locally
Trying to pull repository docker.io/library/alpine ... 
latest: Pulling from docker.io/library/alpine
ff3a5c916c92: Pull complete 
Digest: sha256:7df6db5aa61ae9480f52f0b3a06a140ab98d427f86d8d5de0bedab9b8df6b1c0
Status: Downloaded newer image for docker.io/alpine:latest
ls: can't open '/game': Permission denied
total 0
[root@hostname dew]# docker run -it --rm -v /home/dew/game:/game alpine ls -la /
total 12
drwxr-xr-x    1 root     root            29 May 16 14:35 .
drwxr-xr-x    1 root     root            29 May 16 14:35 ..
-rwxr-xr-x    1 root     root             0 May 16 14:35 .dockerenv
drwxr-xr-x    2 root     root          4096 Jan  9 19:37 bin
drwxr-xr-x    5 root     root           360 May 16 14:35 dev
drwxr-xr-x    1 root     root            66 May 16 14:35 etc
drwxrwxrwx    5 1001     1001          4096 May 15 22:39 game
drwxr-xr-x    2 root     root             6 Jan  9 19:37 home
drwxr-xr-x    5 root     root           234 Jan  9 19:37 lib
drwxr-xr-x    5 root     root            44 Jan  9 19:37 media
drwxr-xr-x    2 root     root             6 Jan  9 19:37 mnt
dr-xr-xr-x  166 root     root             0 May 16 14:35 proc
drwx------    2 root     root             6 Jan  9 19:37 root
drwxr-xr-x    1 root     root            21 May 16 14:35 run
drwxr-xr-x    2 root     root          4096 Jan  9 19:37 sbin
drwxr-xr-x    2 root     root             6 Jan  9 19:37 srv
dr-xr-xr-x   13 root     root             0 May  3 21:42 sys
drwxrwxrwt    2 root     root             6 Jan  9 19:37 tmp
drwxr-xr-x    7 root     root            66 Jan  9 19:37 usr
drwxr-xr-x   11 root     root           125 Jan  9 19:37 var

from docker-eldewrito.

amrelk avatar amrelk commented on July 30, 2024

Another detail: the uid of dew is 1001.

Also, after chowning /home/dew/game to root:root,

[root@hostname dew]# docker run -it --rm -v /home/dew/game:/game alpine ls -la /
total 12
drwxr-xr-x    1 root     root            29 May 16 14:44 .
drwxr-xr-x    1 root     root            29 May 16 14:44 ..
-rwxr-xr-x    1 root     root             0 May 16 14:44 .dockerenv
drwxr-xr-x    2 root     root          4096 Jan  9 19:37 bin
drwxr-xr-x    5 root     root           360 May 16 14:44 dev
drwxr-xr-x    1 root     root            66 May 16 14:44 etc
drwxrwxrwx    5 root     root          4096 May 15 22:39 game
drwxr-xr-x    2 root     root             6 Jan  9 19:37 home
drwxr-xr-x    5 root     root           234 Jan  9 19:37 lib
drwxr-xr-x    5 root     root            44 Jan  9 19:37 media
drwxr-xr-x    2 root     root             6 Jan  9 19:37 mnt
dr-xr-xr-x  164 root     root             0 May 16 14:44 proc
drwx------    2 root     root             6 Jan  9 19:37 root
drwxr-xr-x    1 root     root            21 May 16 14:44 run
drwxr-xr-x    2 root     root          4096 Jan  9 19:37 sbin
drwxr-xr-x    2 root     root             6 Jan  9 19:37 srv
dr-xr-xr-x   13 root     root             0 May  3 21:42 sys
drwxrwxrwt    2 root     root             6 Jan  9 19:37 tmp
drwxr-xr-x    7 root     root            66 Jan  9 19:37 usr
drwxr-xr-x   11 root     root           125 Jan  9 19:37 var
[root@hostname dew]# docker run -it --rm -v /home/dew/game:/game alpine ls -la /game
ls: can't open '/game': Permission denied
total 0

I can ls any of the other directories, even though they are all owned by root. I don’t know why anything is different about them.

from docker-eldewrito.

DomiStyle avatar DomiStyle commented on July 30, 2024

Do you use SELinux? https://stackoverflow.com/questions/24288616/permission-denied-on-accessing-host-directory-in-docker/24334000#24334000

from docker-eldewrito.

amrelk avatar amrelk commented on July 30, 2024

Yep. That’s it. Thank you so much for the help. Everything appears to work now.

from docker-eldewrito.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.