jammsen / docker-palworld-dedicated-server

Docker container to easily provision and manage Palworld Dedicated Server
https://hub.docker.com/r/jammsen/palworld-dedicated-server
MIT License
907 stars 157 forks source link

Setting up palworld volume correct permissions #45

Closed miguelrjim closed 7 months ago

miguelrjim commented 7 months ago

I was having permission issues using this image, the problem was that root was the owner of /palworld which was causing the installation step to fail.

This was caused when specifying a volume in the docker compose file, i.e.

services:
  palworld:
    container_name: palworld
    image: jammsen/docker-palworld-dedicated-server:latest
  volumes:
    - world:/palworld
volumes:
  world:

This should not break existing installations that are working properly.

Jigsaw5279 commented 7 months ago

I came here for the very same reason :)

CameronJGrant commented 7 months ago

Looks good to me.

jammsen commented 7 months ago

I was having permission issues using this image, the problem was that root was the owner of /palworld which was causing the installation step to fail.

This was caused when specifying a volume in the docker compose file, i.e.

services:
  palworld:
    container_name: palworld
    image: jammsen/docker-palworld-dedicated-server:latest
  volumes:
    - world:/palworld
volumes:
  world:

This should not break existing installations that are working properly.

Hey thanks for you contribution.

Ive tried this out and cant even discover your problem.

I did make a complete fresh install and this is what i get: image There is no root permission on that directory is extra down below in the dockerfile after i switch the user to steam so volume creates that directory with all the permissions right for this user. On what SHA-Hash version of the docker-image are you?

This problem should not be existent from my testing and understanding. Please give me so more information about this, so i can recreate the problem and learn something!

miguelrjim commented 7 months ago

I was having permission issues using this image, the problem was that root was the owner of /palworld which was causing the installation step to fail. This was caused when specifying a volume in the docker compose file, i.e.

services:
  palworld:
    container_name: palworld
    image: jammsen/docker-palworld-dedicated-server:latest
  volumes:
    - world:/palworld
volumes:
  world:

This should not break existing installations that are working properly.

Hey thanks for you contribution.

Ive tried this out and cant even discover your problem.

I did make a complete fresh install and this is what i get: image There is no root permission on that directory is extra down below in the dockerfile after i switch the user to steam so volume creates that directory with all the permissions right for this user. On what SHA-Hash version of the docker-image are you?

This problem should not be existent from my testing and understanding. Please give me so more information about this, so i can recreate the problem and learn something!

Sure! The issue happens specifically when you use docker volumes

  volumes:
    - world:/palworld # Here we're binding a docker volume, not a local directory
volumes:
  world: # Here we are defining the docker volume

In the screenshot you shared you're binding a local directory (- ./game:/palworld) which doesn't belong to root so the installation procedure can actually write to it.

jammsen commented 7 months ago

OMFG you mean "Named Volumes" NOW i get it, sorry i have a long line today 🤣 had very much other stuff to take care of and im totally exhausted, but still reading emails about git-comments 00:14 in the morning.

miguelrjim commented 7 months ago

Hahaha no worries! Yeah I should've said named volumes; but yeah that's basically it; i've tested the changes locally and the image is working as expected, thanks for putting it up!

jammsen commented 7 months ago

Need to take a look at this after i sleept sorry. 00:52 and still github maiils open 😑

jammsen commented 7 months ago

I have change things out a little, please go ahead and test this too. See https://github.com/jammsen/docker-palworld-dedicated-server/commit/b6a116e66c4b5f5681e314d46bcff4102297c697

Commit-message: Restructured Dockerfile, less context-switching, less layers needed, improved security and formating, tested also backups

0Downtime commented 7 months ago

Is there any way to handle running under a user thats not 1000? I tried chowning to a user ex. 1001 and the install fails. I tried passing user: 1001:1001 in the compose file but still running into issues.

miguelrjim commented 7 months ago

Is there any way to handle running under a user thats not 1000? I tried chowning to a user ex. 1001 and the install fails. I tried passing user: 1001:1001 in the compose file but still running into issues.

The current process relies on user steam to do all the installation work; having a different puid/pgid should be doable but might require more changes into how the actual game installation is done.

jammsen commented 6 months ago

Is there any way to handle running under a user thats not 1000? I tried chowning to a user ex. 1001 and the install fails. I tried passing user: 1001:1001 in the compose file but still running into issues.

The current process relies on user steam to do all the installation work; having a different puid/pgid should be doable but might require more changes into how the actual game installation is done.

This was already released, feel free to look into the ENV-Var documentation to figure things out.