0

I am new to docker and I have encountered an error after running this script in the command line:

docker-compose up postgres-95 mysql-57

To give you a little more context, I am trying to contribute to Sequelize and I am following the instructions from https://github.com/sequelize/sequelize/blob/master/CONTRIBUTING.md#coding-guidelines

ERROR: for mysql-57  Cannot start service mysql-57: Mounts denied:
The path /mnt/sequelize-mysql-ramdisk
is not shared from OS X and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> File Sharing.
See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.

Starting postgres-95 ... error
ERROR: for postgres-95  Cannot start service postgres-95: Mounts denied:
The path /mnt/sequelize-postgres-ramdisk
is not shared from OS X and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> File Sharing.
See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.

Any help would be greatly appreciated!

EDIT: Don't know if this is helpful but here is the docker-compose.yml:

# PostgreSQL
  postgres-95:
    image: sushantdhiman/postgres:9.5
    environment:
      POSTGRES_USER: sequelize_test
      POSTGRES_PASSWORD: sequelize_test
      POSTGRES_DB: sequelize_test
    volumes:
      - /mnt/sequelize-postgres-ramdisk:/var/lib/postgresql/data
    ports:
      - "8998:5432"
    container_name: postgres-95

  # MySQL
  mysql-57:
    image: mysql:5.7
    environment:
      MYSQL_ROOT_PASSWORD: lollerskates
      MYSQL_DATABASE: sequelize_test
      MYSQL_USER: sequelize_test
      MYSQL_PASSWORD: sequelize_test
    volumes:
      - /mnt/sequelize-mysql-ramdisk:/var/lib/mysql
    ports:
      - "8999:3306"
    container_name: mysql-57
Daniel Vérité
  • 58,074
  • 15
  • 129
  • 156
Alec Davidson
  • 175
  • 1
  • 3
  • 12
  • Does `/mnt/` exist on your Mac? – Dean Coakley Feb 15 '18 at 15:15
  • Possible duplicate of [Docker: Mounts denied. The paths ... are not shared from OS X and are not known to Docker](https://stackoverflow.com/questions/45122459/docker-mounts-denied-the-paths-are-not-shared-from-os-x-and-are-not-known) – Dean Coakley Feb 15 '18 at 15:16
  • @Deancoakley I'm not sure, but I don't believe it does. Also, ill add docker-compose.yml to my question. – Alec Davidson Feb 15 '18 at 15:38

2 Answers2

1

Hey I ran into the same problem, seems it is due a permissions problem. https://docs.docker.com/docker-for-mac/osxfs/#access-contro I solved it this way:

  1. Create a mnt directory by writing in the consle sudo /mnt (In my case I was trying to install postgres so I had to run sudo /mnt/postgres/data). Make sure you're creating it in the root path.
  2. Go to Docker -> Preferences -> File Sharing and add the /mnt directory you just created.
  3. That's it!.

Hope it works! :)

0

My problem was solved by creating the mnt directory in my root directory.

Alec Davidson
  • 175
  • 1
  • 3
  • 12