在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:playniuniu/docker-gui-firefox开源软件地址:https://github.com/playniuniu/docker-gui-firefox开源编程语言:开源软件介绍:Run GUI apps and Firefox with Docker for Mac 2017This article introduce how to run GUI apps and Firefox with Docker for Mac, the purpose is just for fun, maybe can be used for build Website test automation with docker, you can check this. All the commands below are tested with Docker 17.03.0-ce, macOS 10.12.3 and XUbuntu 16.04.2. It include three sections here:
If you don't have so many times, you can just read Finally commands on each end of section :) How to run GUI for LinuxLet's start with a normal GUI app xeyes, here is the Dockerfile based on Alpine Linux: FROM alpine:latest
MAINTAINER [email protected]
RUN apk add --no-cache --update xeyes
CMD xeyes You can built your own images with To run Docker GUI on Linux, You need 3 steps here:
Finally commands
Now you can see an X11 xeyes apps in your screen. How to run GUI for macOSThe macOS is a little more complicate for it's lack of X-Window system, so you need extra two steps to run GUI apps on macOS when you finished build xeyes images.
Notes: Lots of articles online lack of the second step, so cannot successfully run GUI on macOS. For the two steps above, you need install two softwares here:
Finally commandsSo finally, you need five steps for run GUI apps on macOS:
Now, you can see xeyes on your macOS. How to write Firefox DockerfileFor Firefox, all the command steps are same, but you can not just simply replace the package xeyes with Firefox. The Firefox's Dockerfile need some extra steps below to reach the goal:
The Dockerfile example is here: FROM alpine:latest
MAINTAINER [email protected]
ENV URL https://www.google.com
RUN apk --no-cache --update add firefox-esr dbus-x11 ttf-ubuntu-font-family \
&& adduser -S normaluser \
&& echo "normaluser:normaluser" | chpasswd
USER normaluser
CMD firefox --new-instance ${URL} You can also check my GitHub from more detail. Finally commandsFor Linux Platform, you can run Firefox with docker with:
For macOS platform, same five steps as above:
Reference |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论