Docker ENOENT error on alpine
See original GitHub issueHi, I am trying with this dockerfile:
FROM mhart/alpine-node:11.2.0
RUN npm -g config set user root
ENV NODE_PATH=/usr/lib/node_modules
RUN npm install -g html-pdf
RUN npm list -g --depth 0
WORKDIR /usr/src/app
COPY package.json package-lock.json ./
ENV NODE_ENV=production
RUN npm install --only=production
RUN npm audit fix
COPY . .
EXPOSE 8080
CMD ["node", "index.js"]
It installs everything correctly but when I try to use html-pdf I am still getting this error:
{
Error: spawn /node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs ENOENT
at Process.ChildProcess._handle.onexit(internal/child_process.js: 246: 19)
at onErrorNT(internal /child_process.js: 421: 16)
at process.internalTickCallback(internal/process/next_tick.js: 72: 19)
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn /node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs',
path: '/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs',
spawnargs: ['/node_modules/html-pdf/lib/scripts/pdf_a4_portrait.js']
}
I am not setting any phantomPath to html-pdf create options.
I am trying this on https://zeit.co/
RUN npm list -g --depth 0
is returning an empty list
If this problem is unsolvable I could use another image!
I have a working container using node:8.11.1
but it is a 800Mb image and I need something smaller.
What would you use?
Issue Analytics
- State:
- Created 5 years ago
- Comments:8
Top Results From Across the Web
Flow-bin exiting with ENOENT in alpine docker container #8846
I am unable to run flow in Docker Alpine image in ci pipeline after upgrading it to latest version. Similar issues has been...
Read more >ENONENT when executing shell script in Docker container
If you would like to use shell scripts in alpine you have to install a package called bash . It happens because alpine...
Read more >How can I get ng e2e to run under Alpine: it currently returns E ...
ENOENT is a classic symptom of a missing dynamic linker; see e.g. Why does chroot get ENOENT on an existing file?
Read more >How to use Puppeteer inside a Docker container
now i am trying to dockerize it and it get's deployed but throws the following error. "Failed to launch the browser process! spawn...
Read more >no such file or directory, open '/usr/app/package.json' CI error ...
when i'm try to run docker-compose run bona_api ls it only returns node_modules. Dockerfile: FROM node:16.3.0-alpine WORKDIR /usr/app COPY ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Great
console.log("Great")
great