Reputation: 4327
I'm trying to run a node app with xvfb-run
, here is my Dockerfile
FROM node:lts-alpine
RUN apk --no-cache upgrade && apk add --no-cache chromium coreutils xvfb xvfb-run
ENV CHROME_BIN="/usr/bin/chromium-browser"\
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true" \
UPLOAD_ENV="test"
WORKDIR /app
COPY package.json .
COPY .npmrc .
RUN npm install
COPY . .
# EXPOSE 9999
ENTRYPOINT xvfb-run -a npm run dev
I can successfully build the image, but when I run it with docker run
, it gets stuck without any log
But when I open an interactive shell and run the ENTRYPOINT command, it works...
How do I fix it?
Upvotes: 4
Views: 3825
Reputation: 4635
You should add --init
to docker run
, for example:
docker run --init --rm -it $IMAGE$ xvfb-run $COMMAND$
Upvotes: 3