#Quickstart Docker Issue ($25 Reward to first person to solve issue).

4 messages · Page 1 of 1 (latest)

jagged pewter
#

If the reward isn't allowed here, I'll edit that out.

When I follow these directions, I have an issue. Postgres and Redis are both fine, but I get this error.

Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/var/lib/docker/volumes/medusatrial_node_modules/_data" to rootfs at "/app/medusa/node_modules": mkdir /var/lib/docker/overlay2/72d07468dd90be1e6bf6e45792e76006264892a8498599641bfcda3608e332ee/merged/app/medusa/node_modules: operation not permitted: unknown

I'm on a Mac M2 ProMax. The directory in question (/app/medusa/node_modules) exists in the local volume. I haven't found anything on line that has helped me yet. The directory it's in is /Users/me/dockerstorage/medusatest/

Here's my docker-compose.yml file:

services:
  backend:
    build:
      context: .
      dockerfile: Dockerfile
    image: backend:starter
    container_name: medusa-server-default
    depends_on:
      - postgres
      - redis
    environment:
      DATABASE_URL: postgres://postgres:postgres@postgres:5432/medusa-docker
      REDIS_URL: redis://redis
      NODE_ENV: development
      JWT_SECRET: something
      COOKIE_SECRET: something
      PORT: 9000
    ports:
      - "9000:9000"
    volumes:
      - .:/app/medusa
      - node_modules:/app/medusa/node_modules

  postgres:
    image: postgres:10.4
    ports:
      - "5432:5432"
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      POSTGRES_DB: medusa-docker

  redis:
    image: redis
    ports:
      - "6379:6379"

volumes:
  node_modules:
lilac oriole
#

Hi. Isn't it a problem with permissions? you can try changing the permissions of the directory that you are mounting as a volume
sudo chmod -R 777 /Users/me/dockerstorage/medusatest/

or you can change the owner of the directory to the same user running Docker by running:

sudo chown -R $USER:$USER /Users/me/dockerstorage/medusatest/

#

Eventually I am not sure if mounting local node_modules in the container is right.
- node_modules:/app/medusa/node_modules

jagged pewter
#

I think the permissions are correct but I will check. I have loaded node_modules locally in other environments so I think that's correct, especially since this is going on the default configuration from the website.