8

在 Docker 裡面跑 GUI 程式的點子

 2 years ago
source link: https://blog.gslin.org/archives/2022/03/28/10632/%e5%9c%a8-docker-%e8%a3%a1%e9%9d%a2%e8%b7%91-gui-%e7%a8%8b%e5%bc%8f%e7%9a%84%e9%bb%9e%e5%ad%90/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

在 Docker 裡面跑 GUI 程式的點子

昨天的 Hacker News Daily 上看到「Running GUI apps within Docker containers」這篇文章,裡面想要把程式包到 Docker container 裡面,然後給了一些想法,另外在「Running GUI apps within Docker containers (trickster.dev)」這邊也有一些討論與想法可以看。

要注意的是,這邊主要是以 X11 類的環境為主 (所以應該還是 Linux 了),而文章是用 Firefox 當例子,不過主要應該還是會拿來跑其他的東西...

看起來 GUI 的部份主要就是先用 VNC + x11vnc 打通到 host 的 X11 環境,這邊會需要 xhost 開授權讓 container 內的程式可以控制 X11 的環境 (話說他範例裡面直接開 xhost + 也真讚)。

後面提到的 noVNC 則是把 VNC 轉到 HTML5 上面讓瀏覽器可以操作,就不是那麼感興趣。

另外在討論裡面也有人直接放大絕,把一堆權限放進去 container:

docker run -it --rm -e DISPLAY --net=host -v $XAUTHORITY:/root/.Xauthority -v /tmp/.X11-unix:/tmp/.X11-unix debian:11-slim

不過整體看起來算是提供了一些思路... 算是除了 Flatpak 外的一些方法。

Related

在 Docker 裡面跑 GUI 程式

由於想把一些東西隔離放到 Docker 裡跑,所以找了些資料看看怎麼做。 在「Running GUI apps with Docker」這邊講了怎麼在 Docker 裡面跑 Firefox,不過在我的電腦上有狀況 (跑起來沒問題,但開網頁後 Firefox 就會 crash),也許再找時間看看吧... 不過這邊學到了把 X11 的相關資源丟進去的方式: docker run -ti --rm \ -e DISPLAY=$DISPLAY \ -v /tmp/.X11-unix:/tmp/.X11-unix \ firefox 不過畢竟是把整個 X11 資源都暴露進去了,技術上並不安全,只能跑一些大公司的程式,這些公司至少不能明目張膽的把 screenshot 一直傳回去... (還是其實都有做?@_@) 另外是 Skype,之前在「用 Docker 跑 Skype 講電話」這邊就有提過了。而另外一個是「tomparys/docker-skype-pulseaudio」。但之前發現中文字型都還是有問題,也續要看看他們的 Dockerfile 怎麼寫,然後自己再改一下,把中文的部份包進去... 然後是 Dropbox,在經過「Dropbox Responds to Mac 'Security…

December 11, 2016

In "Computer"

在 Docker 裡跑 ZeroNet

在「Play: A P2P Distributed Torrent Site That's Impossible to Shut Down」這邊看到 ZeroNet,標語是使用 P2P 分散式站台: Real-time updated, P2P websites using Bitcoin cryptography and the BitTorrent network 想說丟進 Docker 裡玩看看,測了一下沒什麼問題,只要 port forwarding 打幾個洞就好了。 先開 port 15441 (對外溝通) 與 port 43110 (UI 用),這兩個是預設值: $ docker run -p 15441:15441 -p 0.0.0.0:43110:43110 -t -i ubuntu:14.04…

March 8, 2016

In "Computer"

Docker Desktop 要開始對商用收費了,以及 Open Source 版本的設法

Hacker News Daily 上看到的,Docker Desktop 修改了他的授權條件,對於商用版本要開始收費了:「Docker Desktop no longer free for large companies: New 'Business' subscription is here」,養套殺的過程... 目前看到的條件是 250 人以下的公司,而且年營業額在 10m 美金以下的情況免費,另外個人、教育以及非商業的 open source 專案保持免費: It remains free for small businesses (fewer than 250 employees AND less than $10 million in annual revenue), personal use, education, and non-commercial open…

September 2, 2021

In "Computer"

a611ee8db44c8d03a20edf0bf5a71d80?s=49&d=identicon&r=gAuthor Gea-Suan LinPosted on March 28, 2022Categories Computer, Linux, Murmuring, OS, Privacy, Security, SoftwareTags container, docker, gui, isolation, privacy, security, vnc, x11, x11vnc

Leave a Reply

Your email address will not be published. Required fields are marked *

Comment *

Name *

Email *

Website

Notify me of follow-up comments by email.

Notify me of new posts by email.

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Learn More)

Post navigation


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK