Electron inside Docker with X11 Forwarding - No Protocol Specified - docker

I am attempting to run the Electron Quick Start in a Docker container with X11 forwarding. I've got all the appropriate packages figured out but when I run the container I get No protocol specified. I'm not sure what I'm missing to get it to work.
Dockerfile
FROM node
RUN apt-get update
RUN apt-get -y install libgtkextra-dev libgconf2-dev libnss3 libasound2 libxtst-dev libxss1 libx11-xcb-dev
WORKDIR /srv
ADD . .
RUN npm install
ENTRYPOINT ["npm", "start"]
Build and Run
docker build -t electron .
docker run -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY electron
Output
npm info it worked if it ends with ok
npm info using npm#4.1.2
npm info using node#v7.7.2
npm info lifecycle electron-quick-start#1.0.0~prestart: electron-quick-start#1.0.0
npm info lifecycle electron-quick-start#1.0.0~start: electron-quick-start#1.0.0
> electron-quick-start#1.0.0 start /srv
> electron .
No protocol specified
npm info lifecycle electron-quick-start#1.0.0~start: Failed to exec start script
npm ERR! Linux 4.8.0-41-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v7.7.2
npm ERR! npm v4.1.2
npm ERR! code ELIFECYCLE
npm ERR! electron-quick-start#1.0.0 start: `electron .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron-quick-start#1.0.0 start script 'electron .'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the electron-quick-start package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! electron .
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs electron-quick-start
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls electron-quick-start
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /srv/npm-debug.log
Q: What is the correct way of running Electron apps inside Docker?

In your host machine run xhost local:root then try running your container to run electron

Related

How do I install a node module in a Cypress Docker container?

In the path ~/cypress-dockerfile I have the following Dockerfile:
FROM cypress/base:10
RUN npm install --save-dev cypress
WORKDIR /node_modules
RUN npm install sqlite3
RUN $(npm bin)/cypress verify
RUN $(npm bin)/cypress run
I then run docker build . but it stops with the following:
Step 4/6 : RUN npm install sqlite3
---> Running in 13de6b7a4fcf
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
> sqlite3#5.0.0 install /node_modules/sqlite3
> node-pre-gyp install --fallback-to-build
sh: 1: node-pre-gyp: not found
npm WARN enoent ENOENT: no such file or directory, open '/package.json'
npm WARN !invalid#1 No description
npm WARN !invalid#1 No repository field.
npm WARN !invalid#1 No README data
npm WARN !invalid#1 No license field.
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! sqlite3#5.0.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the sqlite3#5.0.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-08-07T13_28_54_118Z-debug.log
The command '/bin/sh -c npm install sqlite3' returned a non-zero code: 1
I think that I may be in the wrong directory but I am not sure, any help would be appreciated.

docker container with Nestjs app fail to start

Hi I'm beginner with Docker
I use the Docker Desktop on Windows (Linux Containers) to manage containers and I need to create a container with a NestJs application.
I built the image containing the app but when I want to run a container with this image I get this error:
> helloworld#0.0.1 start /usr/src/app
> nest start
/usr/src/app/node_modules/.bin/nest: line 1: ../#nestjs/cli/bin/nest.js: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! helloworld#0.0.1 start: `nest start`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the helloworld#0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-05-12T09_10_04_973Z-debug.log
my Dockerfile is like this
FROM node:current-slim
WORKDIR /usr/src/app
RUN npm i -g #nestjs/cli
COPY package.json /usr/src/app/package.json
RUN npm install
COPY . .
EXPOSE 3000
CMD ["sh", "-c", "npm run start"]
With this dockerfile it's working on Linux but on Windows I get the error.
I tried to use nestjs official docker image instead of node but I get same error.

"node module " missing error in jenkins pipeline build

I have dockerfile containing the angular build section as below.
RUN apt-get update && apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN apt-get install -y nodejs
RUN npm config set registry https://shnexus0.sohard.de/repository/sedi.npm.development/
RUN npm i -g #angular/cli#latest
RUN npm install
RUN npm install -g typescript
In the jenkins pipeline build I am getting the below error.
error TS2307: Cannot find module '#angular/core'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! dicom-web-viewer#0.0.0 tsc: `tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the dicom-web-viewer#0.0.0 tsc script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
Even though I have npm install in the dockerfile. It is showing the error for node module. Thanks in advance.

Having trouble running a docker image 'quorra not found'

After allot of ado I was able to build my dockerimage, but when I try and run it I get the following error:
$ docker run swipeimage
> uswipe-merchant#0.0.1 dev /var/app
> NODE_ENV=development quorra ride --watch --env development
sh: quorra: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! uswipe-merchant#0.0.1 dev: `NODE_ENV=development quorra ride --watch --env development`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the uswipe-merchant#0.0.1 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-12-05T10_01_14_455Z-debug.log
I tried adding RUN npm install quorrato my docker file to make sure quorra is installed but still get an error.
Finally got it, I was looking at the quorra docs, and I changed
RUN npm install quorra
to
RUN npm install -g quorra-cli
Now it works!!!
Thanks All

Integrate Spine with juggernaut

I am trying to integrate Spine with Juggernaut. First I tried to clone fowa branch (https://github.com/maccman/spine.rails3/tree/fowa) but I am not able to clone that branch so I am doing app myself following by maccman/spine.rails3 instead of Pusher I used Juggernaut. For Juggernaut I followed maccman/Juggernaut (https://github.com/maccman/juggernaut/tree/)
I installed the redis server by
sudo apt-get install redis-server
Already I installed npm
spritle#ubuntu:~$ npm -v
1.0.106
For
npm install -g juggernaut
npm ERR! Could not create /usr/local/lib/node_modules/___juggernaut.npm
npm ERR! error installing juggernaut#2.1.0 Error: EACCES, Permission denied '/usr/local/lib/node_modules/___juggernaut.npm'
npm ERR! Error: EACCES, Permission denied '/usr/local/lib/node_modules/___juggernaut.npm'
npm ERR! Report this *entire* log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR!
npm ERR! System Linux 2.6.32-21-generic
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "juggernaut"
npm ERR! cwd /home/spritle
npm ERR! node -v v0.5.5-pre
npm ERR! npm -v 1.0.106
npm ERR! path /usr/local/lib/node_modules/___juggernaut.npm
npm ERR! code EACCES
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/spritle/npm-debug.log
npm not ok
I am getting this error
So I did
npm install juggernaut
For this I am getting
juggernaut#2.1.0 ./node_modules/juggernaut
├── redis#0.6.6
├── node-static-maccman#0.5.3
├── optimist#0.2.8 (wordwrap#0.0.2)
└── socket.io#0.8.6
After that I did
gem install juggernaut
For
spritle#ubuntu:~$ sudo /etc/init.d/redis-server start
I am getting
Starting redis-server: redis-server.
For
spritle#ubuntu:~$ juggernaut
I am getting
juggernaut: command not found
So for http://localhost:8080
I am getting
Unable to connect error
I installed the redis and juggernaut. When i run localhost:8080 I am getting error.
I don't know what i did wrong. Anyone can help me.
I am an idiot i want to start the juggernaut server at where i was installed. Instead of that i started the setver in other place. Now i can able to connect to juggernaut. I can access http://localhost:8080. Now i started juggernaut at
spritle#ubuntu:/usr/local/lib/node_modules/juggernaut$ juggernaut server.js

Resources