1

I just started a project with meteor on Docker. When it runs meteor after meteor npm install it gives this error

[[[[[ /var/app ]]]]]

=> Started proxy.
/root/.meteor/packages/meteor-tool/.1.4.1_1.139xb76++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/isopackets/ddp/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:165
      throw error;
      ^

Error: EPROTO: protocol error, symlink '/root/.meteor/packages/meteor-tool/.1.4.1_1.139xb76++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules' -> '/var/app/.meteor/local/.build677392.build/programs/.build850480.server/node_modules'
    at Error (native)

For the record I am running docker through virtualbox on my Win 10. It seems the problem is about failing creating symlinks, but I have installed the same virtualbox expansion pack version and symbolic for shared folders already enabled on my virtualbox. What other possibilities cause the issue?

UPDATE

As in this suggestion to put --no-bin-links to meteor npm install doesn't have any effect.

spondbob
  • 1,523
  • 2
  • 17
  • 34

1 Answers1

0

I have a solution inspired from this answer. Basically instead of figuring out how to fix the symlinks, we "move" the meteor local files into its own volume. This can be done by creating a volume through docker-compose. The setup will be

version: '2'

services:
  webpack:
    build:
      context: .
      dockerfile: Dockerfile
    volumes:
      - .:/var/app
      - node_modules:/var/app/node_modules
      - meteor_local:/var/app/.meteor/local
    ports:
      - 3000:3000
    links:
      - db
    environment:
      - LANG=en_US.UTF-8
      - LC_ALL=en_US.UTF-8
  db:
    image: mongo
volumes:
  node_modules:
    driver: local
  meteor_local:
    driver: local

As you can see by having .meteor/local mounted into meteor_local it allows whatever process that needs to create symlinks to run inside the container space separated from the shared folder that causes the process to fail. Having this approach means no need to add --no-bin-links after npm install

Community
  • 1
  • 1
spondbob
  • 1,523
  • 2
  • 17
  • 34