A
A
Arthur2019-03-14 13:27:25
Docker
Arthur, 2019-03-14 13:27:25

Problem with docker compose read-only file system?

Good afternoon, need help with docker-compose
config

version: '3'
services:
  php-fpm:
    build:
      context: ./docker/php-fpm
  nginx:
    build:
      context: ./docker/nginx
    volumes:
      - ./src:/var/www

error
ERROR: for nginx Cannot start service nginx: error while creating mount source path '/var/www/docker/src': mkdir /var/www: read-only file system

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
Correcter, 2020-11-15
@Corrector

Check the owner for folders inside /var/lib/docker . Most likely, you started the docker engine as root, while using docker-compose up from your account, or something is wrong with the file system itself.
Then just restart: sudo service docker reload
Also check that you haven't run out of capacity, either in free bytes or in free indexes:
df /var/lib/docker/.
df -i /var/lib/docker/.

P
PashaWNN, 2019-09-10
@PashaWNN

Well, at least you didn't include the dockerfiles.
In general, there may be two reasons for this: an unofficial docker build (especially the build from the snap package manager suffers from this error) or incorrectly configured rights in the containers themselves.
The first is treated by reinstalling according to the offsite instructions, and the second is easy to check by trying to start the container with the --priveleged flag. If it helps, then continue to dig into the dockerfile.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question