It won't build with Docker
See original GitHub issueWhen adding the prerender-spa-plugin
to an existing app following the Vue doc : https://vuejs-templates.github.io/webpack/prerender.html or when cloning this repo’s examples, it can build both applications normally on my host (yarn 1.3.2, node 8.6.0) but not inside a container, with Docker.
I’ve tried the node:latest
(9.0.0), node:carbon-alpine
(8.9.0 on alpine), node:carbon
and node_boron
(6.11) images.
I ran the build with npm (v3 and v5) and yarn (1.2.1).
Nothing seems to make it work.
I also tried to give it my host’s node_modules, or fetch them inside the container, nothing helped.
Here’s the error thrown by the plugin:
[...]/node_modules/prerender-spa-plugin/lib/compile-to-html.js:82
if (error) throw stdout
^
Full log:
yarn run v1.2.1
$ node build/build.js
(node:26) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
/usr/src/app/node_modules/prerender-spa-plugin/lib/compile-to-html.js:82
if (error) throw stdout
^
error Command failed with exit code 1.
The Dockerfile is extremely simple (and works without the prerender-spa-plugin
for the same app:
FROM node:carbon-alpine
WORKDIR /usr/src/app
COPY . .
RUN yarn && yarn build
Reproduction:
Copy the above docker file and try to build the image docker build -t app .
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:6
Top GitHub Comments
This worked for us to get puppeteer running within a docker instance:
Solved this by using
node:carbon-wheezy
instead ofcarbon-alpine
Thanks to this discussion: https://github.com/marcbachmann/node-html-pdf/issues/233