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

BUG: docker-compose tries to bind mount folders from root machine #157

Open
jelhan opened this issue Aug 2, 2024 · 0 comments
Open

BUG: docker-compose tries to bind mount folders from root machine #157

jelhan opened this issue Aug 2, 2024 · 0 comments
Labels
bug Something isn't working design needed Design details needed to complete the issue enhancement New feature or request

Comments

@jelhan
Copy link

jelhan commented Aug 2, 2024

Describe the bug

docker compose up fails with the following error when I run it on my local machine:

error while creating mount source path '/var/www/html': mkdir /var/www: read-only file system

The error is caused by the nginx service. I can reproduce it with docker compose up nginx as well. There isn't any additional information in the log:

$ docker compose up nginx
[+] Running 6/6
 ✔ Network dejacode_default     Created                                                                                                                                       0.1s 
 ✔ Container dejacode-clamav-1  Created                                                                                                                                       0.1s 
 ✔ Container dejacode-db-1      Created                                                                                                                                       0.1s 
 ✔ Container dejacode-redis-1   Created                                                                                                                                       0.1s 
 ✔ Container dejacode-web-1     Created                                                                                                                                       0.1s 
 ✔ Container dejacode-nginx-1   Created                                                                                                                                       0.0s 
Attaching to nginx-1
Gracefully stopping... (press Ctrl+C again to force)
Error response from daemon: error while creating mount source path '/var/www/html': mkdir /var/www: read-only file system

I tested with v5.1.0 and latest main branch (956a807). I'm seeing the same error for both.

Investigation

DejaCode's Docker Compose setup bind mounts to paths on the machine hosting the containers: https://github.com/nexB/dejacode/blob/956a80790d41a3cf44a51869a9b1eadca55fc2ac/docker-compose.yml#L74

On my machine the folder /var/www does not exist. The user under which docker runs doesn't seem having permissions to create it.

To Reproduce

Ensure that user under which docker runs does not have access permissions writing to /var/www.

  1. git clone git@github.com:nexB/dejacode.git
  2. git checkout v5.1.0
  3. docker compose build
  4. docker compose up

Expected behavior

docker compose up should start DejaCode as long as the machine has a working Docker setup. It should not rely on the machine's file system.

Screenshots

n.a.

Context (OS, Browser, Device, etc.):

  • Docker version 27.1.1, build 6312585
  • Docker Compose version v2.29.1
  • Ubuntu 23.10
@jelhan jelhan added bug Something isn't working design needed Design details needed to complete the issue enhancement New feature or request labels Aug 2, 2024
tdruez added a commit that referenced this issue Aug 26, 2024
Signed-off-by: tdruez <tdruez@nexb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working design needed Design details needed to complete the issue enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant