Menu
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.
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.
![]()
Docker does not provide a display server that would allow to run applications with a graphical user interface. X11docker fills the gap. It runs an X display server on the host system and provides it to Docker containers. Additionally x11docker does some security setup to enhance container isolation and to avoid X security leaks. Running GUI applications using Docker for Mac Install XQuartz. You can install XQuartz using homebrew with brew cask install xquartz or directly from the website here. Install Docker for Mac. Install docker using brew cask install docker or directly from the website here. Docker allows to run applications in an isolated container environment. Containers need much less resources than virtual machines for similar tasks. Docker does not provide a display server that would allow to run applications with a graphical user interface. X11docker fills the gap. You can certainly experiment with it, but using Docker for GUI applications is still a rough ride because Docker was not designed for that. It was designed for sysadmins to run services. This is most apparent by the fact that you have to be root to use Docker, and if you aren't (because of adding yourself to the docker group), you can still easily become root.
Outlook mail app for mac. 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
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.
Parallels desktop 3.0 mac download. https://renewnewyork.weebly.com/download-safari-6-for-mac.html. 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:
Running Gui Apps With Docker MacosFuture 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 :) Logitech mac webcam app.
Docker Display Gui
Hand on comparison of os for iphone x vs s10. 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.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |