alekzonder / docker-puppeteer

docker image with Google Puppeteer installed
https://hub.docker.com/r/alekzonder/puppeteer/
MIT License
486 stars 138 forks source link

Node modules conflict #11

Open markelog opened 6 years ago

markelog commented 6 years ago

What if I would install module foo (for example), which would require compiling with something like node-gyp, then with the code like this:

const puppeteer = require('puppeteer');
const foo = require('foo');
....

and with executing recommended command like this:

$ docker run --shm-size 1G --rm -v <my-application>:/app/index.js alekzonder/puppeteer:latest

My foo module would be used on the environment it wasn't compiled for, correct?

Furthermore, what if my project has a module which has puppeteer in dependencies (i.e. something like this – https://github.com/americanexpress/jest-image-snapshot) my understanding is when you do –

const puppeteer = require('puppeteer');
...

puppeteer would be loaded of one of submodule, not of the docker one?

If so, what would be the recommended workaround?