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

Docker compose error while creating mount source path #188

Open
tylnesh opened this issue Oct 14, 2024 · 1 comment
Open

Docker compose error while creating mount source path #188

tylnesh opened this issue Oct 14, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@tylnesh
Copy link

tylnesh commented Oct 14, 2024

I happened upon an old issue with docker distributed in the snap. When using our Dockerfile with volumes defined as such:
volumes: - type: bind source: /opt/something/data target: /opt/something/data bind: create_host_path: true

I get this error:
Error response from daemon: error while creating mount source path '/opt/something/data': mkdir /opt/something: read-only file system

Seems like it's the same issue as here: https://stackoverflow.com/questions/45764477/docker-compose-error-while-creating-mount-source-path

@locnnil
Copy link
Contributor

locnnil commented Dec 2, 2024

As snap packages add additional layers of security, the behavior that you listed is expected.

By default, a strictly confined snap (such as the Docker snap) cannot access the entire system. Instead, there are specific data locations where the snapped application is allowed access. Additionally, there are snap interfaces that grant extra permissions, enabling the application inside the snap to function properly.

The applications inside the Docker snap itself uses several of these interfaces, like for dockerd:

- firewall-control
- home
- log-observe
- network-bind
- network-control
- privileged
- support
- graphics-core22
As well the Docker CLI
- docker-cli
- network
- home
- removable-media
and Docker Compose:

- docker-cli
- network
- home

While I understand this setup might not be ideal for development purposes, it’s designed to ensure maximum security and reliability, making it a perfect fit for production scenarios.

Thank you for bringing this up, and I hope this explanation helps clarify things!

@locnnil locnnil added the documentation Improvements or additions to documentation label Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants