久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何在 docker 上運(yùn)行電子應(yīng)用程序

How to run an electron app on docker(如何在 docker 上運(yùn)行電子應(yīng)用程序)
本文介紹了如何在 docker 上運(yùn)行電子應(yīng)用程序的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我創(chuàng)建了一個托管電子應(yīng)用程序的存儲庫的分支,該應(yīng)用程序是一個聊天客戶端:https://github.com/Serkan-devel/BetterDiscordApp-docker.

I've created a fork of a repository hosting an electron app which is a chat client: https://github.com/Serkan-devel/BetterDiscordApp-docker.

我要做的是創(chuàng)建一個 docker 容器,其 GUI 連接到自己的屏幕,例如 https://blog.jessfraz.com/post/docker-containers-on-the-desktop/ .

What I'm trying to do is to create a docker container with a GUI hooked to the own screen like at https://blog.jessfraz.com/post/docker-containers-on-the-desktop/ .

我創(chuàng)建的 dockerfile 如下:

The dockerfile I've created goes like:

FROM node:slim

COPY . /usr/scr/app

#RUN rm bdstart.sh

RUN npm install --save-dev electron

RUN npm install

#ENV FRESHINSTALL=true

CMD ["/usr/scr/app/start.sh"]

start.sh 文件如下:

The start.sh file goes like:

./node_modules/.bin/electron ./src

構(gòu)建 docker 鏡像并使用它執(zhí)行后

After building the docker image and execute it with

docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY --device /dev/snd dixord

我得到錯誤代碼:

standard_init_linux.go:175: exec user process caused "exec format error"

雖然我使文件可執(zhí)行并使用了正確的 amd64 架構(gòu).

although I made the file executable and used the right amd64 architecture.

有沒有人想出如何讓電子圖形用戶界面在 docker 工作上更加天真?

Has anyone figured it out how to make electron GUI's naitively over docker work?

推薦答案

我會盡力在這個答案中幫助你 - 太長了,無法評論.

I will try to help you here in this answer - too long for comment.

我在我的 Win10 上嘗試了你的 Docker 文件,但遇到了同樣的問題.但是我通過添加所需的包并成功創(chuàng)建了 docker 映像來解決這個問題.這里是 Dockerfile

I tried your Docker file on my Win10 and with the same problems. But I figured it out by adding required packages and successfully created docker image. Here is Dockerfile

   FROM node:slim

   COPY . /usr/scr/app

   #RUN rm bdstart.sh
   RUN apt-get update

   # I think you need to install following 
   RUN apt-get -y install libgtkextra-dev libgconf2-dev libnss3 libasound2 libxtst-dev libxss1
   RUN npm install --save-dev electron

   RUN npm install

   CMD ["/usr/scr/app/start.sh"]

這是你的 start.sh

   #!/bin/sh
   ./node_modules/.bin/electron ./src

實(shí)際上我無權(quán)訪問您的文件等,但是有了這個 DockerFile 能夠毫無問題地創(chuàng)建 docker 映像.我還進(jìn)入了 docker 容器并檢查是否可以運(yùn)行電子 - 工作.

Actually I don't have access to your files and so on, but with this DockerFile was able to create docker image without problems. I also went inside docker container and check whether is possible to run electron - worked.

如果你想進(jìn)入容器,你只需要構(gòu)建 docker 鏡像.我已經(jīng)通過(最簡單的方式)按照命令(打開控制臺Dockerfile所在的位置并運(yùn)行):

If you want to go into container, you just need to build docker image. I have done it by (simplest way) following command (open console where Dockerfile is located and run):

   docker build -t test-image .

成功構(gòu)建鏡像后,您可以運(yùn)行容器.如果有任何問題,我建議您使用 bash 入口點(diǎn)運(yùn)行容器并調(diào)試失敗的內(nèi)容 - bash 將在您鍵入以下腳本的同一控制臺中打開)

After Successfully build of image you can run container. If any problems I recommend you to run container with bash entrypoint and debug what fails - bash will open in the same console where you type following script)

   docker run -it test-image bash

這篇關(guān)于如何在 docker 上運(yùn)行電子應(yīng)用程序的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

How to fix BrowserWindow is not a constructor error when creating child window in Electron renderer process(在 Electron 渲染器進(jìn)程中創(chuàng)建子窗口時如何修復(fù) BrowserWindow 不是構(gòu)造函數(shù)錯誤) - IT屋-程序員軟件開發(fā)技術(shù)
mainWindow.loadURL(quot;https://localhost:3000/quot;) show white screen on Electron app(mainWindow.loadURL(https://localhost:3000/) 在 Electron 應(yīng)用程序上顯示白屏)
Electron webContents executeJavaScript : Cannot execute script on second on loadURL(Electron webContents executeJavaScript:無法在第二個 loadURL 上執(zhí)行腳本)
how to use electron browser window inside components in angular-cli?(如何在angular-cli的組件內(nèi)使用電子瀏覽器窗口?)
ElectronJS - sharing redux store between windows?(ElectronJS - 在 Windows 之間共享 redux 存儲?)
How to access camera/webcamera inside electron app?(如何在電子應(yīng)用程序中訪問相機(jī)/網(wǎng)絡(luò)攝像頭?)
主站蜘蛛池模板: 国产在线观看不卡一区二区三区 | 日本亚洲一区二区 | 欧美嘿咻| 视频三区| 国产日韩一区二区三免费 | 欧美电影一区 | 亚洲福利一区 | 久久这里只有 | 香蕉久久久久久 | 精品美女| av国产精品 | 99精品免费视频 | 久久蜜桃精品 | 伊人精品 | 麻豆国产精品777777在线 | 国产精品成人在线播放 | 久久精品欧美一区二区三区麻豆 | 久久伦理中文字幕 | 亚洲欧美日韩精品 | 麻豆视频国产在线观看 | 精精国产xxxx视频在线播放 | 欧美综合一区二区 | 国产欧美日韩一区二区三区 | 国产精品久久久久一区二区三区 | 成人毛片在线观看 | 久久精品欧美一区二区三区不卡 | 成人亚洲一区 | 国产在线视频一区二区董小宛性色 | 久久久www成人免费精品 | 五月综合久久 | 久久久久久久成人 | 亚洲精品视频在线观看视频 | 精品毛片 | 美女国产 | 亚洲一区精品在线 | 欧美一区二区精品 | 久久99精品久久久久蜜桃tv | 欧美xxxx色视频在线观看免费 | 视频1区2区| 在线观看涩涩视频 | 精品久久久久久亚洲精品 |