i’m new with docker en i’m running into an issue.
i’m running the command “docker compose up” and and i’m getting the following error.
Error response from daemon: error while creating mount source path ‘/opt/portainer’: mkdir /op t/portainer: read-only file system.
but I think I “enabled” all permissions (maybe too much) as you can see here:
services:
portainer:
container_name: portainer
image: portainer/portainer
restart: always
ports:
- "9000:9000/tcp"
environment:
- TZ=Europe/Amsterdam
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /opt/portainer:/data
homeassistant:
container_name: homeassistant
image: "ghcr.io/home-assistant/home-assistant:stable"
volumes:
- /opt/homeassistant/config:/config
- /etc/localtime:/etc/localtime:ro
- /run/dbus:/run/dbus:ro
restart: unless-stopped
privileged: true
network_mode: host
I hope I have give you all the information you need to help me out.
Oh, I see the problem: you are using the snap package of docker.
I always considered the snap version as broken, as it does not behave like vanilla docker. Furthermore, the snap version and versions from distribution repositories are not supported in this forum.
its a few days later but now i have the same issue while i using the command docker start container (name)
so it looks like it is not solved.
here again the results of the two commands after i installed the correct docker version.
stat /opt/portainer
Please, check the instructions shared by @meyay again and make sure you remove the snap package as otherwise it is possible you run multiple docker daemons and you still connect to the wrong one.
snap remove docker
or
snap remove --purge docker
Rebooting the host machine could also be required.