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

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

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

問題描述

我創(chuàng)建了一個(gè)托管電子應(yīng)用程序的存儲庫的分支,該應(yīng)用程序是一個(gè)聊天客戶端: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)建一個(gè) 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?

推薦答案

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

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

我在我的 Win10 上嘗試了你的 Docker 文件,但遇到了同樣的問題.但是我通過添加所需的包并成功創(chuàng)建了 docker 映像來解決這個(gè)問題.這里是 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)訪問您的文件等,但是有了這個(gè) 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)建子窗口時(shí)如何修復(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:無法在第二個(gè) 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ò)攝像頭?)
主站蜘蛛池模板: 风间由美一区二区三区 | 欧美理论在线观看 | 日韩在线观看一区 | 久久免费小视频 | 中文字幕在线免费视频 | 一级黄色录像片 | 日日日干干干 | 精品一区二区在线播放 | 国产伦精品一区二区三区四区免费 | 综合伊人久久 | 精品久久视频 | 亚洲激情视频在线观看 | 久久久久久久久国产 | 国产精品二区一区二区aⅴ污介绍 | 青青草国产在线视频 | 交换多p群乱高h文 | 在线观看国产小视频 | 视频一区在线播放 | www.中文字幕 | 黄色小视频在线免费观看 | aaa国产精品| 黄色特级毛片 | 日日撸夜夜操 | 亚洲精品一区二区三区精华液 | 视频一区二区在线 | 欧美精品一区在线 | 国产精品久久久久久久成人午夜 | 久久伊人影院 | 久久久97 | 拍床戏真做h文黄肉1v1 | 午夜美女福利视频 | 91成年人 | 色综合色综合网色综合 | 黄色91网站 | 可以免费看av的网站 | 国产欧美一区二区三区视频在线观看 | 成人一区二区三区 | 中文字幕在线免费观看 | 亚洲一级二级三级 | 日韩av在线免费 | 欧美在线小视频 |