Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker compose error while creating mount source path

I have created a docker-compose.yml using cloudestuary. After downloading it and putting it in my Laravel project folder and running docker-compose up -d the download takes place and then I get this message:

ERROR: for worker-1 Cannot start service worker-1: error while creating mount source path '/var/www/html/lensin/html': mkdir /var/www: read-only file system

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

ERROR: for app Cannot start service app: error while creating mount source path '/var/www/html/lensin/html': mkdir /var/www: read-only file system

ERROR: for workspace Cannot start service workspace: error while creating mount source path '/var/www/html/lensin/html': mkdir /var/www: read-only file system ERROR: Encountered errors while bringing up the project.

I`m on Ubuntu 17, and have tried even to set 777 to all folders, and running it with sudo, but the result is the same. I have also tried to move the file and to edit the volumes in yml.

Here is my docker compose file:

version: '2'
services:
    nginx:
        image: 'cloudestuary/nginx:mainline-fpm'
        restart: always
        environment:
            CLIENT_MAX_BODY_SIZE: 100m
            DOCUMENT_ROOT: /var/www/html/public
            INDEX_FILE: index.php
            PHP_FPM: app
        networks:
            - app
        volumes:
            - './html:/var/www/html'
        ports:
            - '80:80'
    app:
        image: 'cloudestuary/php-fpm:7.1'
        restart: always
        environment:
            MAX_UPLOAD_FILE_SIZE: 100m
            APP_URL: 'http://lensin.localhost'
            APP_KEY: 'base64:2X9U1HiBdmfbwvZ4UkwUP/25svg7439HXKWL1F8Xn1c='
            DB_CONNECTION: mysql
            DB_HOST: mysql
            DB_PORT: '3306'
            DB_DATABASE: cloudestuary
            DB_USER: cloudestuary
            DB_PASSWORD: secret
        networks:
            - app
        volumes:
            - './html:/var/www/html'
    workspace:
        image: 'cloudestuary/php-workspace:7.1'
        restart: always
        ports:
            - '2222:22'
        environment:
            MAX_UPLOAD_FILE_SIZE: 100m
            APP_URL: 'http://lensin.localhost'
            APP_KEY: 'base64:2X9U1HiBdmfbwvZ4UkwUP/25svg7439HXKWL1F8Xn1c='
            DB_CONNECTION: mysql
            DB_HOST: mysql
            DB_PORT: '3306'
            DB_DATABASE: cloudestuary
            DB_USER: cloudestuary
            DB_PASSWORD: secret
            SSH_PASSWORD: xsKEVWXPrdAeg
        networks:
            - app
        volumes:
            - './html:/var/www/html'
    worker-1:
        image: 'cloudestuary/php-cli:7.1'
        restart: always
        networks:
            - app
        environment: {  }
        volumes:
            - './html:/var/www/html'
        command: 'php artisan queue:work'
    mysql:
        image: 'mysql:5.7'
        restart: always
        networks:
            - app
        environment:
            MYSQL_ROOT_PASSWORD: toor
            MYSQL_PASSWORD: secret
            MYSQL_USER: cloudestuary
            MYSQL_DATABASE: cloudestuary
        volumes:
            - 'mysql-data:/var/lib/mysql'
volumes:
    mysql-data: {  }
networks:
    app: {  }
like image 372
Marko Marjanovic Avatar asked Aug 18 '17 20:08

Marko Marjanovic


1 Answers

It's likely a pathing issue with Docker when installed with snap, you're better off installing it with the official documentation from Docker.

Remove docker from snap

snap remove docker

Remove the docker directory, and old version (It's okay if these don't exist already)

rm -R /var/lib/docker

sudo apt-get remove docker docker-engine docker.io

Install the official docker package: https://docs.docker.com/install/linux/docker-ce/ubuntu/

like image 94
HyperionX Avatar answered Sep 17 '22 14:09

HyperionX