0

I am trying to set physical path to my volume that used in Spring Boot project with docker. When i try to up my docker-compose it shows error

Cannot start service sb-service: error while creating mount source path '/usr/share/nginx/html/image': mkdir /usr/share/nginx: read-only file system

I set chmod 777 to

/usr/share/nginx 
/usr/share/nginx/html
/usr/share/nginx/html/image

also i created image folder with sudo mkdir image as well.

This is my docker compose file

sb-service:
     image: sb-service
     container_name: sb-service
     environment:
               SPRING_DATASOURCE_URL: 'jdbc:mysql://mysql_db:3306/ECommerce?useUnicode=yes&characterEncoding=UTF-8&useSSL=false'
     ports: 
      - '8085:8085'
     expose: 
      - '8085'
     volumes:
           - /usr/share/nginx/html/image:/root/images
Abdullah Tellioglu
  • 1,434
  • 1
  • 10
  • 26
  • 1
    [This](https://stackoverflow.com/questions/58034955/read-only-file-system-when-attempting-mkdir-data-db-on-mac) and [this](https://stackoverflow.com/questions/52526219/docker-mkdir-read-only-file-system) may help? – LingSamuel Sep 09 '20 at 01:42

1 Answers1

0

I followed Docker - mkdir read-only file system this and removed old docker snap. Purged all docker things and reinstall all of them. Problem solved

Abdullah Tellioglu
  • 1,434
  • 1
  • 10
  • 26