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

如何在 docker 上運行電子應用程序

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

問題描述

我創建了一個托管電子應用程序的存儲庫的分支,該應用程序是一個聊天客戶端: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.

我要做的是創建一個 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/ .

我創建的 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

構建 docker 鏡像并使用它執行后

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"

雖然我使文件可執行并使用了正確的 amd64 架構.

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 文件,但遇到了同樣的問題.但是我通過添加所需的包并成功創建了 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

實際上我無權訪問您的文件等,但是有了這個 DockerFile 能夠毫無問題地創建 docker 映像.我還進入了 docker 容器并檢查是否可以運行電子 - 工作.

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.

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

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 .

成功構建鏡像后,您可以運行容器.如果有任何問題,我建議您使用 bash 入口點運行容器并調試失敗的內容 - 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

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

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

相關文檔推薦

How to fix BrowserWindow is not a constructor error when creating child window in Electron renderer process(在 Electron 渲染器進程中創建子窗口時如何修復 BrowserWindow 不是構造函數錯誤) - IT屋-程序員軟件開發技術
mainWindow.loadURL(quot;https://localhost:3000/quot;) show white screen on Electron app(mainWindow.loadURL(https://localhost:3000/) 在 Electron 應用程序上顯示白屏)
Electron webContents executeJavaScript : Cannot execute script on second on loadURL(Electron webContents executeJavaScript:無法在第二個 loadURL 上執行腳本)
how to use electron browser window inside components in angular-cli?(如何在angular-cli的組件內使用電子瀏覽器窗口?)
ElectronJS - sharing redux store between windows?(ElectronJS - 在 Windows 之間共享 redux 存儲?)
How to access camera/webcamera inside electron app?(如何在電子應用程序中訪問相機/網絡攝像頭?)
主站蜘蛛池模板: 操久久| 欧美一区二区三区的 | 黄色毛片在线看 | 亚洲精品一区二区三区四区高清 | 欧美色影院 | 欧美综合一区二区 | 一区二区精品 | 福利av在线 | 欧美成人一区二区三区 | 成人h片在线观看 | 国产精品99久久久久久宅男 | 国产日韩一区二区三区 | 一级做a| 黄色国产| 欧美黄色一级毛片 | 国产高清精品一区二区三区 | 999久久久久久久久6666 | 亚洲人成一区二区三区性色 | 久久er99热精品一区二区 | 97色免费视频 | 亚洲精品成人在线 | 久久爱综合 | 日韩一区二区三区精品 | 高清黄色 | 精品99爱视频在线观看 | 国产日韩欧美一区 | 欧洲妇女成人淫片aaa视频 | 久久久久精 | 久久精品| 日韩国产一区二区三区 | 久久精品国产99国产 | 亚洲小视频 | 亚洲精品一区二区三区蜜桃久 | 久久青| 中文字幕一区二区在线观看 | 91精品一区二区三区久久久久久 | 亚洲成人一区二区三区 | 欧美黄色性生活视频 | 九色.com | 久久亚洲一区二区三区四区 | 免费看的av|