I’ve been doing all of my real (paid) work on VMs / containers for a while now but when it comes to writing Java code for some projects for university I stillneed to move away from using vim and install some full blown IDE in order to beproductive. This has been bothering me for quite some time but this week Iwas finally able put the pieces together to run NetBeans in a Docker container so that I can avoidinstalling a lot of Java stuff on my machine that I don’t use on a daily basis.
Run GUI apps and Firefox with Docker for Mac 2017. This 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. Maybe we have a Linux GUI app that hasn't been ported to Mac OS X, we can run it inside a virtual Ubuntu instance and with XQuartz display it on the Mac desktop. We have documented a similar solution using a Docker container: Run Linux/X11 apps in Docker and display on a Mac OS X desktop.
There are a few different options to run GUI applications inside a Dockercontainer like using SSH with X11 forwarding,or VNC but the simplest one that Ifigured out was to share my X11 socket with the container and use it directly.
The idea is pretty simple and you can easily it give a try by running a Firefoxcontainer using the following
Dockerfile as a starting point:
docker build -t firefox . it and run the container with:
If all goes well you should see Firefox running from within a Docker container.
Getting a NetBeans container up and running
# docker run -ti -rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix firefox Conclusion. Running GUI Apps in a Docker Container is really an awesome experience which will never harm/use your host Filesystem. It is fully dependent on your Docker Container. In this tutorial, we tried Firefox in our CentOS 7 Docker Image with Firefox installed. We can use many more GUI Apps with this technology. Kitematic is the default GUI that ships with Docker for Mac and Windows. I won’t cover it.
Preparing a NetBeans base image was not that straightforward since we need toinstall some additional dependencies (namely the
libxext-dev , libxrender-dev and libxtst-dev packages) in order to get it to connect to the X11 socketproperly. I also had trouble using OpenJDK and had to switch to Oracle’s Javafor it to work.
Thanks for sharing, OP. There's a whole bunch of GUI apps here - even stuff like Skype! Take a look at this video as well - the developer shares her techniques for low-level system peeking to help understand what each container needs to run.
After lots of trial and error, I was finally able to make it work and the resultis a base image available at the Docker Hubwith sources on GitHub.
Here’s a quick demo of it in action:
Future work
Over the next few months I’ll be working on a Play!app and will hopefully write a blog post on the workflow I used. Stay tunned for more :)
PS: This approach of sharing the X11 socket also be applied to vagrant-lxccontainers and I’ll document that on the project’s Wiki when Ihave a chance.
31 Jul 2016 #Docker
A quick guide on how to run containers requiring a GUI with Docker for Mac and XQuartz.
Mac app file encrypt. This guide is assuming the following:
PrerequisitesXQuartz
You’ll need XQuartz, and normally you would probably install it via brew (but not this time):
XQuartz 2.7.9, which is the current one provided by brew, has a bug which will prevent you from following this guide. So, head on over and download XQuartz 2.7.10 beta 2 from here.
After installing XQuartz, log out and back in to OS X. Alfred app mac deutsch.
Docker for Mac
Download Docker for Mac 1.12 stable from here, install and run.
Running Gui Apps Docker MacosGo!
Run XQuartz in e.g. bash:
In the XQuartz preferences, go to the “Security” tab and make sure you’ve got “Allow connections from network clients” ticked:
Running Gui Apps Docker Mac Os
Again, in e.g. bash, run
xhost and allow connections from your local machine:
Docker Gui Applications
You can now to run e.g. Cant delet app on mac. Jessie Frazelle’s Firefox container:
Running Gui Apps Docker Mac InstallPlease enable JavaScript to view the comments powered by Disqus.Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |