0

I'm trying to run an electron app in docker. I have created the docker image successfully using the command "docker build. -t pi/electron-app-node16", when I try to run the docker image (docker run pi/electron-app-nod16) getting this error "/app/node_modules/electron/dist/electron exited with signal SIGTRAP"

DOCKERFILE

FROM node:16-bullseye

RUN apt-get update && apt-get install \
    git libx11-xcb1 libxcb-dri3-0 libxtst6 libnss3 libatk-bridge2.0-0 libgtk-3-0 libxss1 libasound2 \
    -yq --no-install-suggests --no-install-recommends \
    && apt-get clean && rm -rf /var/lib/apt/lists/*

RUN apt-get update && export DEBIAN_FRONTEND=noninteractive && apt-get -y install --no-install-recommends xorg openbox libnss3 libasound2 libatk-adaptor libgtk-3-0    

RUN apt-get update 

RUN apt-get -y install vim nano mlocate

WORKDIR /app

COPY . .

RUN chown -R node /app

USER node
RUN npm install

USER root

RUN chown root /app/node_modules/electron/dist/chrome-sandbox

RUN chmod 4755 /app/node_modules/electron/dist/chrome-sandbox

RUN apt-get update || : && apt-get install python3 -y

RUN apt-get -y install python3-pip

RUN pip install -r requirements.txt


USER node

CMD npm start

enter image description here

Klaus D.
  • 13,874
  • 5
  • 41
  • 48
  • Running GUI applications in a Docker container is tricky and not portable across host OSes (see [Can you run GUI applications in a Linux Docker container?](https://stackoverflow.com/questions/16296753/can-you-run-gui-applications-in-a-linux-docker-container). How are you running the container? What error are you actually getting? Would it be easier to run this process directly on the host system? – David Maze Apr 25 '22 at 10:44
  • @DavidMaze "docker run pi/electron-app-nod16" this is the command i used for running the image, I also attached the error screenshot above – Muhammed Fazil Apr 26 '22 at 11:39

0 Answers0