Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't run docker compose with mongo and mounted volume #1679

Closed
hguerrero opened this issue Feb 28, 2022 · 7 comments
Closed

can't run docker compose with mongo and mounted volume #1679

hguerrero opened this issue Feb 28, 2022 · 7 comments
Labels
area/volume Access to host volumes from inside the VM or containers kind/bug Something isn't working platform/macos

Comments

@hguerrero
Copy link

hguerrero commented Feb 28, 2022

Actual Behavior

When trying to run a docker-compose file that uses mongo db with a mounted volume (for persisting data). The volume is mounted in a way that does not allow the container to execute chown.

Steps to Reproduce

  1. docker-compose.yaml:
version: '2'
services:
  mongo:
    image: mongo:3.4.23
    container_name: db
    volumes:
      - "./data:/data/db"
  1. run docker compose up -d

Result

[+] Running 1/0
 ⠿ Container db  Recreated                                                                                                                         0.0s
Attaching to db
db  | chown: changing ownership of '/data/db': Permission denied

Expected Behavior

container runs correctly

Additional Information

No response

Rancher Desktop Version

1.0.1

Rancher Desktop K8s Version

1.23.3

Which container runtime are you using?

moby (docker cli)

What operating system are you using?

macOS

Operating System / Build Version

macOS Big Sur 11.6.3

What CPU architecture are you using?

x64

Linux only: what package format did you use to install Rancher Desktop?

No response

Windows User Only

No response

@hguerrero hguerrero added the kind/bug Something isn't working label Feb 28, 2022
@buenoleo1982
Copy link

same problem with me

@jandubois jandubois added area/volume Access to host volumes from inside the VM or containers platform/macos labels Mar 4, 2022
@rafaribe
Copy link

rafaribe commented Mar 9, 2022

Same here

Error response from daemon: error while creating mount source path './data/logs': chown ./data/logs: permission denied

MacOS Monterey 12.2.1

@guild-jonathan-kaczynski

This might be the same issue as #1209?

@saurabh-cimpress
Copy link

I have the same issue. any solution?

@WUUUGI
Copy link

WUUUGI commented Mar 16, 2022

I am facing similar problems using bind mounts in docker-compose. The bind mounts do not work as expected and files will not be mounted from host file system to container file system.

I checked and I am missing permissions for the docker-mounts directory as it seems.

@ggustafsson
Copy link

As @guild-jonathan-kaczynski has already mentioned this is probably a duplicate of #1209 so look in that one for an explanation and status.

@hguerrero Might be a good idea to close this issue to avoid confusing people.

@hguerrero
Copy link
Author

Closing as duplicate of #1209

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/volume Access to host volumes from inside the VM or containers kind/bug Something isn't working platform/macos
Projects
None yet
Development

No branches or pull requests

8 participants