Docker: read-only error from Host OS

I am trying to start an additional container in docker and get a read-only error.

My Raspi 4 is running Home Assistant OS 2021.1.1, I have Portainer installed and SSH access. I have write access via SSH.

But when I start a container:
docker run -d --name fhem -p 8083:8083 -v /data/fhem:/opt/fhem fhem/fhem

I get the error message
docker: Error response from daemon: error while creating mount source path ‘/dat a/fhem’: mkdir /data: read-only file system.

How can docker access a folder to use it as volume in my docker container?

I’m new to Home Assistant.

As far as I know you can’t do this without some non-persistent workaround.
With a Supervised or Container installation you could run any amount of additional docker stacks.

Maybe I found a solution. I was able to create a (docker) volume with Portainer and bind it to a path in the container. I don’t know where the volume is stored, it has a mount path /mnt/data/docker/volumes/fhem_vol/_data. I guess this is a path in the Host OS? When I look on my Pi with the SSH Addon there is nothing in mnt.

So I don’t understand how but there is persistence now.

I just figured out that volumes can be mounted with the following base path: /mnt/data/supervisor/ following the default paths like addons backup config media share ssl

4 Likes