netbrain / zwift

Easily zwift on linux
The Unlicense
241 stars 27 forks source link

Using named volume instead of file mounts #20

Closed netbrain closed 1 year ago

netbrain commented 1 year ago

Circumventing podman and UID/GID's issues by using a named volume for zwift persisted config instead of relying on file mounts.

Fixes #19

quietvoid commented 1 year ago

It would be nice to have instructions in the readme on creating said volume. I ran into permission issues since my mounted volume config didn't have the right permissions by default.

Just copied from some googling:

docker volume create zwift-$USER
docker run -d --rm --name dummy -v zwift-$USER:/data alpine tail -f /dev/null
docker cp ~/.config/zwift/. dummy:/data

But the Zwift directory owner was root by doing this, instead of user (UID 1000).

netbrain commented 1 year ago

It's already in the readme I believe.

On Sun, Sep 17, 2023, 16:52 quietvoid @.***> wrote:

It would be nice to have instructions in the readme on creating said volume. I ran into permission issues since my mounted volume config didn't have the right permissions by default.

Just copied from some googling:

docker run -d --rm --name dummy -v zwift-$USER:/data alpine tail -f /dev/nulldocker cp ~/.config/zwift/. dummy:/data

But the Zwift directory owner was root by doing this, instead of user (UID 1000).

— Reply to this email directly, view it on GitHub https://github.com/netbrain/zwift/pull/20#issuecomment-1722494454, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACTNC7BSZIKB7ZNYKMK2TLX24FDRANCNFSM6AAAAAA4WXT2MQ . You are receiving this because you modified the open/close state.Message ID: @.***>

quietvoid commented 1 year ago

It isn't, there's just an example on copying the credentials to the volume. I guess for an initial setup, a user wouldn't have the preferences files yet anyways so the volume would be empty. But I think it still has to be created.

netbrain commented 12 months ago

When launching zwift for the first time:

Podman seems to create permissions root:netbrain (root:user-group) for named volumes if they don't exist. However, when mounted into the zwift container, it seems to be re-mapped to user:user (which is the containers standard user account)

So this should be fine.

Docker seems to create the named volume with netbrain:netbrain permissions on the host system and within the container it's re-mapped to user:user

You are not seeing the same behavior on your system I take it?

quietvoid commented 12 months ago

I hadn't tried, I didn't know if Docker would automatically create the named volume so I just did it manually.

netbrain commented 12 months ago

Ah i see, in that case you would be better off just deleting the volume you created manually and simply let docker/podman create it when launching the container first time. and then afterwards you can add your specific config files as detailed in the README