Docker Community Forums

Share and learn in the Docker community.

Docker-compose Permission denied

I get an error when I am using docker-compose.
Permission denied: ‘etc/dockerstorage/portainer-docker-compose.yml’
I get the same results with and without sudo.

I am on Ubuntu 20.04 - installed docker via snap
Docker-compose version: 1.25.5
Docker version: 19.03.13

docker-compose -f /etc/dockerstorage/portainer-docker-compose.yml -up -d

portainer-docker-compose.yml:
version: ‘3.3’
services:
portainer-ce:
container_name: portainer
ports:
- ‘9000:9000’
volumes:
- ‘//var/run/docker.sock:/var/run/docker.sock’
- ‘//etc/dockerstorage/portainer:/data’
restart: unless-stopped
image: portainer/portainer-ce

When I use the docker run it works just fine

docker run -d --name portainer -p 9000:9000 -v “//var/run/docker.sock:/var/run/docker.sock” -v “//etc/dockerstorage/portainer:/data” --restart=unless-stopped portainer/portainer-ce

I found the problem.

It seems that the SNAP installation on Ubuntu is not working out of the box. I could not figure out how to make it work.

Instead I dropped SNAP and did a simple apt-get

apt install docker.io docker-compose