2 years ago
#4166

Xentrax
Change file ownership for external persistent volume of MySQL Container
This is a tricky one.
I have the official MySQL Docker container with a persistent volume. I realized that the performance was quite bad, so I stopped the container, moved the files on the host system from the HDD to an SSD and changed the mountpoint, so the users within the container can access the files at the same place again.
Because I moved the files, the ownership got transferred to the host root user.
When I start the container, the root user inside the container finds the files and detects that the file permissions are wrong. It tries to change them with chown, which it obviously doesn't have permission for.
Now how can I transfer the file ownership to the container user again? I need the UID, but I can't exec in the container to get it, because it immediately stops.
Any idea what I could do?
docker
containers
chown
0 Answers
Your Answer