0

I'm trying to run a puppeteer instance with headless: false inside a VM, so I need an interface, that's why I'm using xvfb.

But after trying to run the command: xvfb-run --auto-servernum I get: xvfb-run: usage error: need a command to run even running the command directly on the docket image

this is the docker file I'm using:

FROM node:latest

ENV CHROME_BIN="/usr/bin/chromium"
RUN apt-get update && apt-get install -yq gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation
RUN apt-get install -yq libappindicator1; exit 0
RUN apt-get -f install
RUN apt-get install -yq libnss3 lsb-release xdg-utils wget xvfb x11vnc x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic x11-apps chromium

ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
    PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium

ADD package.json /usr/app/package.json
COPY ./index.js /usr/app/index.js
WORKDIR /usr/app
RUN npm install
RUN groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser && mkdir -p /home/pptruser/Downloads && chown -R pptruser:pptruser /home/pptruser && chown -R pptruser:pptruser /usr/app
ENV DISPLAY :99
RUN chmod 777 /usr/app/index.js
USER pptruser
#CMD ["xvfb-run", "--server-args=\"-screen 0 1024x768x24\""]
#docker run -p 3000:3000 --cap-add=SYS_ADMIN pupet

Then I'm building locally:

docker build --tag=testinterface .

Then I'm runnin the docker image on interative mode to running from there:

docker run -it testinterface /bin/bash

Then I run the command:

xvfb-run --auto-servernum

That's when I get: enter image description here

Which makes not sense because I'm already passing the parameter to run

John Balvin Arias
  • 2,632
  • 3
  • 26
  • 41

1 Answers1

0

You are passing the option -a, not a command.