-
Notifications
You must be signed in to change notification settings - Fork 519
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Can't run nodejs_image with Puppeteer #2979
Comments
yeah chromium requires some shared libraries on the machine, these dependencies aren't captured by bazel, so a custom base image is the right answer. The "No Permission" errors are the things to diagnose. Does that help? you can update the repro to point to some image that has the needed dynamic shared objects. |
I've updated the repro to use this (drakery/node-puppeteer) as a base image. Running
|
Fixed it by using this Dockerfile as a base: FROM ubuntu:20.04
# Install Node.js
RUN apt-get update \
&& apt-get install -y curl
RUN curl --silent --location https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get install --yes nodejs
RUN apt-get install --yes build-essential
# Install Chrome
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y wget gnupg \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/* I pulled it in Bazel like this: load("@io_bazel_rules_docker//container:container.bzl", "container_pull")
container_pull(
name = "ubuntu",
digest = "sha256:a1ceb3aac586b6377821ffe6aede35c3646649ee5ac38c3566799cd04745257f",
registry = "docker.io",
repository = "drakery/node-puppeteer",
) And used it like this: nodejs_image(
name = "custom_ubuntu",
base = "@ubuntu//image",
binary = "server",
) Here is the final working repository: https://github.com/flolu/bazel-node-puppeteer/tree/050376d36bccb67a93933882a459f0af3051eabd |
I want to run Puppeteer in a Node.js app on a Kubernetes cluster.
This is my setup:
Everything works fine when running the image locally on my Ubuntu machine.
But the image doesn't run in Docker:
Some dependencies are not available in the Docker container.
With a Dockerfile, they could be installed like this.
How can I add such "apt-get install dependencies" to my
nodejs_image
?I've tried to change
base
image ofnodejs_image
to a custom-built image viacontainer_pull
. But this resulted in some weird "No permission" errors.A minimal reproduction of the issue can be found here: https://github.com/flolu/bazel-node-puppeteer
The text was updated successfully, but these errors were encountered: