简体   繁体   中英

Permission denied trying `docker-compose build` in virtualbox shared folder

I get .IOError: [Errno 13] Permission denied: './docker-compose.yml' when trying to run docker-compose build inside shared folder from virtualbox. Even if I try it with sudo .

My host machine runs windows 10 and guest OS is ubuntu 18.04.2.

The directory is mounted from virtualbox GUI as permanent, auto-mounted shared folder.

To access this folder I added my user to vboxsf group.

sudo chown -R user /mount/projects has no effect.

UPDATE

Using just a Dockerfile with hello-world and commands docker build --tag=sometag . and docker run sometag works perfectly.

Here is content of my docker-compose.yml :

version: "3"

services:
  build:
    context: .
    dockerfile: ./Dockerfile

Dockerfile is the same with hello-world.

Any ideas?

Fixed by reinstalling docker with:

sudo apt-get remove docker-ce docker-ce-cli containerd.io
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo apt install docker-compose

And adding my user to gruop docker .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM