問題描述
我創建了一個托管電子應用程序的存儲庫的分支,該應用程序是一個聊天客戶端: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:
start.sh 文件如下:
The start.sh file goes like:
構建 docker 鏡像并使用它執行后
After building the docker image and execute it with
我得到錯誤代碼:
雖然我使文件可執行并使用了正確的 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
這是你的 start.sh
實際上我無權訪問您的文件等,但是有了這個 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):
成功構建鏡像后,您可以運行容器.如果有任何問題,我建議您使用 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 上運行電子應用程序的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!