Docker volume help

Joined
Apr 13, 2017
Messages
513
Location
PA
Wondering if there are any Docker / Linux experts out there familiar with Filezilla.

Setup is on a cheap Racknerd VPS running headless. My kids are into Minecraft Bedrock which I kinda have running pretty well.

I started playing around with Portainer and Docker and went down a bit of a rabbit hole. The nice thing is that I can spin on up a new server really quickly if they want to play in a new world.

The problem comes up when I need to modify something in the persistent volumes. (The server "resource" files sit in volumes, and to modify them with new toys or server mods - you have to add files).

I have been trying to use Filezilla to move files, but am running into permission issues when I try to copy files. Docker volumes are mapped to /var/lib/docker/volumes/...

I'm hesitant to mess with ownership of this volume because I figure the Docker devs know what they are doing keeping the permissions tight. But I have been struggling with sudo MV commands, and was hoping for something graphical, but not a full OS. Can anyone point me in a different direction?

(If I'm honest, I am still lost with Linux file permissions, and groups).
 
You're ok using mv, as it will preserve owner, group, and perms.

For example if you have a directory owned by root that you want to move just do: mv /dir/to/move /new_path/ and you'll get /new_path/move

root will still be the owner. Of course you'll need to be root or do sudo to mv a dir owned by root.
 
I recommend using rsync instead of mv, as it will perfectly preserve all permissions, inclusions ACLs.

Here is an example:

sudo rsync -aAXv --progress /mnt/source/ /mnt/target/
  • -a: This stands for "archive" and ensures that symbolic links, devices, attributes, permissions, ownerships, etc. are preserved.
  • -A: This preserves ACLs (Access Control Lists).
  • -X: This preserves extended attributes.
  • -v: This increases verbosity.
  • --progress: This shows progress during the transfer.
 
Thanks guys. I'm frustrated with permissions on the Docker directory. For whatever reason, the user I am logged into gets a permission denied - even when using sudo. The docker container has no issue accessing and writing to the volume container. I did a chmod to at least be able to use command ls on the data directory (750 I think). to see the structure.

I have to do a couple / three steps. And can't figure out how to do it efficiently.

1. Use Filezilla to move from a remote device to /tmp on the server. (They are actually zip files, so I download and unzip them first on remote device)
2. Move from tmp and overwrite an existing data directory
3. Move files from the overwritten directory to another directory.

Would rsync work here, or do I need to look into cp?

Thanks!
 
Back
Top