Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mstdmstd's avatar

Running docker app I got error : _work: read-only file system

Hello, I try to run my laravel 7 app docker under on my home laptop(Kubuntu 18) and got unexpected errors:

$ docker-compose up -d --build           
Building web
[WARNING]: Empty continuation line found in:
    RUN apt-get update &&     apt-get install -y     python     libfreetype6-dev     libwebp-dev     libjpeg62-turbo-dev     libpng-dev     libzip-dev     nano     mc     git-core     curl     build-essential     openssl     libssl-dev     libgmp-dev     libldap2-dev     netcat     locate     && git clone https://github.com/nodejs/node.git &&   cd node    && git checkout v12.0.0   && ./configure   && make   && make install
[WARNING]: Empty continuation lines will become errors in a future release.
Step 1/8 : FROM php:7.3-apache
 ---> 20155fe4a974
Step 2/8 : RUN apt-get update &&     apt-get install -y     python     libfreetype6-dev     libwebp-dev     libjpeg62-turbo-dev     libpng-dev     libzip-dev     nano     mc     git-core     curl     build-essential     openssl     libssl-dev     libgmp-dev     libldap2-dev     netcat     locate     && git clone https://github.com/nodejs/node.git &&   cd node    && git checkout v12.0.0   && ./configure   && make   && make install
 ---> Using cache
 ---> 9aa258ef129f
Step 3/8 : RUN npm install cross-env
 ---> Using cache
 ---> 6439d3bf3413
Step 4/8 : RUN npm install -g yarn
 ---> Using cache
 ---> 74de2bcbbd9f
Step 5/8 : RUN  docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-webp-dir=/usr/include/  --with-jpeg-dir=/usr/include/
 ---> Using cache
 ---> d9558ab78615
Step 6/8 : RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
 ---> Using cache
 ---> efed7310658d
Step 7/8 : RUN  docker-php-ext-install gd pdo pdo_mysql zip gmp bcmath pcntl ldap sysvmsg exif  && a2enmod rewrite
 ---> Using cache
 ---> 0d5aeb75837f
Step 8/8 : COPY virtualhost.conf /etc/apache2/sites-enabled/000-default.conf
 ---> Using cache
 ---> cfcf4aebb475

Successfully built cfcf4aebb475
Successfully tagged docker_web:latest
Starting hostels3_web ... 
Starting hostels3_composer ... 
Starting hostels3_web                                                                                                                                                                                                  
hostels3_db is up-to-date                                                                                                                                                                                              
Starting hostels3_composer                                                                                                                                                                                             
Starting hostels3_adminer ...                                                                                                                                                                                          
Starting hostels3_composer ... error
                                                                                                                                                                                                                       
Starting hostels3_adminer ... error
                                                                                                                                                                                                                       
Starting hostels3_web ... error
                                                                                                                                                                                                                       
ERROR: for hostels3_web  Cannot start service web: error while creating mount source path '/_work/wwwroot/lar/hostels3': mkdir /_work: read-only file system

ERROR: for web  Cannot start service web: error while creating mount source path '/_work/wwwroot/lar/hostels3': mkdir /_work: read-only file system

ERROR: for adminer  Cannot start service adminer: OCI runtime create failed: container with id exists: 6186b90cbab305276cc19ba24e7dd4d38408740e133889bd368db1fcc989431a: unknown

ERROR: for composer  Cannot start service composer: error while creating mount source path '/_work/wwwroot/lar/hostels3': mkdir /_work: read-only file system
ERROR: Encountered errors while bringing up the project.

I check :

$ docker info
Client:
 Debug Mode: false

Server:
 Containers: 6
  Running: 3
  Paused: 0
  Stopped: 3
 Images: 45
 Server Version: 19.03.11
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc version: 
 init version: fec3683
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 4.15.0-121-generic
 Operating System: Ubuntu Core 16
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 7.711GiB
 Name: AtHome
 ID: 634A:HXQC:3CRK:RFFZ:X7IR:3V6W:23FQ:JD3B:ILAK:4ZI3:JSD7:A45D
 Docker Root Dir: /var/snap/docker/common/var-lib-docker                                                                                                                                                               
 Debug Mode: false                                                                                                                                                                                                     
 Registry: https://index.docker.io/v1/                                                                                                                                                                                 
 Labels:                                                                                                                                                                                                               
 Experimental: false                                                                                                                                                                                                   
 Insecure Registries:                                                                                                                                                                                                  
  127.0.0.0/8                                                                                                                                                                                                          
 Live Restore Enabled: false                                                                                                                                                                                           
                                                                                                                                                                                                                       
WARNING: No swap limit support                                                                                                                                                                                         
$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
docker_web          latest              cfcf4aebb475        47 hours ago        2.07GB
adminer             latest              476c78d02a95        5 days ago          89.9MB
master_app          latest              7a3cd36c8bbc        4 weeks ago         5.72GB
php                 7.3-apache          20155fe4a974        5 weeks ago         410MB
mysql               5.7                 ef08065b0a30        2 months ago        448MB
composer            1.8                 3874930a8658        8 months ago        181MB
mysql               5.7.28              db39680b63ac        10 months ago       437MB
$ docker ps    
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                 NAMES
d0008034a6b0        mysql:5.7.28        "docker-entrypoint.s…"   6 weeks ago         Up 26 minutes       3306/tcp, 33060/tcp   hostels3_db

I reinstalled my Kubuntu 18 since I used this app under docker and in /etc/fstab I have :

/dev/sdb8 /mnt/_work_sdb8  ntfs-3g  defaults  0  0 
/dev/sda8 /mnt/Media_sda8 ntfs-3g  defaults  0  0  
/dev/sda6 /mnt/Work_sda6  ntfs-3g  defaults  0  0 

and I created link to my directory with command :

ln  -s   /mnt/_work_sdb8/   /_work

That is why in error /_work/wwwroot/lar/hostels3 is root path of the app ...

Dockerfile.yml :

FROM php:7.3-apache

RUN apt-get update && \
    apt-get install -y \
    python \
    libfreetype6-dev \
    libwebp-dev \
    libjpeg62-turbo-dev \
    libpng-dev \
    libzip-dev \
    nano \
    mc \
    git-core \

#    libmagickwand-dev --no-install-recommends && \
#    pecl install imagick && imagick && \
#    docker-php-ext-enable imagick && \

    curl \
    build-essential \
    openssl \
    libssl-dev \
    libgmp-dev \
    libldap2-dev \
    netcat \
    locate \
    # composer \
    && git clone https://github.com/nodejs/node.git && \
  cd node  \
  && git checkout v12.0.0 \
  && ./configure \
  && make \
  && make install

  RUN npm install cross-env

  RUN npm install -g yarn

  RUN  docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-webp-dir=/usr/include/  --with-jpeg-dir=/usr/include/


  # Install Composer
  RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

  RUN  docker-php-ext-install gd pdo pdo_mysql zip gmp bcmath pcntl ldap sysvmsg exif  \
&& a2enmod rewrite

  # RUN install-php-extensions imagick

COPY virtualhost.conf /etc/apache2/sites-enabled/000-default.conf

Why this error and how it can be fixed?

0 likes
0 replies

Please or to participate in this conversation.