Add the option -v /mnt/data:/data to the docker run command to have minio saving data to host directory.
Minio cannot write to data directory because of permission error.
Created minio configuration file successfully at /root/.minio
ERROR Unable to initialize backend: Unable to write to the backend.
> Please ensure Minio binary has write permissions for the backend.
I am probably doing something stupid; solution is to point out the obvious thing I'm missing.
Starting with the simplest case.
Create folder on host where data will reside:
sudo su
mkdir /mnt/data
chmod -R 777 /mnt/data
Run a new docker container:
docker run -p 9000:9000 --name minio1 \
-v /mnt/data:/data \
minio/minio server /data
Result:
Created minio configuration file successfully at /root/.minio
ERROR Unable to initialize backend: Unable to write to the backend.
> Please ensure Minio binary has write permissions for the backend.
I just want to move from the super-toy example of spinning up a minio docker container to the somewhat toy example of binding the minio /data directory to the host /mnt/data directory.
centos-atomic-host 7.1805It was a silly issue; posting solution for posterity. Key issue was this:
Docker host: centos-atomic-host 7.1805
Atomic host runs SELinux by default. Turning off SELinux resolves the issue.
Atomic host runs SELinux by default. Turning off SELinux resolves the issue.
Do you have any docs which allow us to provide SELinux make this work?
For Project Atomic you can also set append :z or :Z to the have SElinux allow writing to the container:
docker run -p 9000:9000 --name minio1 \
-v /mnt/data:/data:z \
minio/minio server /data
More info at:
https://www.projectatomic.io/blog/2016/03/dwalsh_selinux_containers/
@eco-minio command works. Thanks!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
For Project Atomic you can also set append :z or :Z to the have SElinux allow writing to the container:
docker run -p 9000:9000 --name minio1 \
-v /mnt/data:/data:z \
minio/minio server /data
More info at:
https://www.projectatomic.io/blog/2016/03/dwalsh_selinux_containers/