Containerizing Desktop Applications with Docker

Docker is really popular with developers. A big part of the appeal is the ability to containerize server applications like WordPress, Apache and even leveraging images of Linux operating systems. Most of my experience is in the end user computing (EUC) space with a heavy focus on desktop applications delivered to physical desktops, virtual desktops and session hosts.

Docker containers appeal to me because of the open platform. It’s awesome to simply pull and run any application I want without fear of conflicts or introducing problems to my machine. It’s like Chocolatey but without the worry that somebody fucked up the package.

On a personal note, the simplicity for me to test changes to my website in a container is a big win AND recently I’ve been looking more and more at IoT projects and fun projects for my Raspberry Pi devices.

That’s all fine and dandy for developers  and hobbyists but what about desktop applications?

The great Jessie Frazelle presented this awesome session at DockerCon 2015 with some hacks and fun images which included some GUI desktop applications like Tor and Skype. Jessie even has some really fun images like Super Mario Bros and Zelda running with a NES emulator. You can find a blog post on this topic at: https://blog.jessfraz.com/post/docker-containers-on-the-desktop/.

There’s a great example of Chrome in which you can also containerize the resources it will use. This is really sweet because Chrome is a major hog. You can download Jessie’s Dockerfiles from her GitHub repo.

Run a Containerized Chrome on your Desktop

Download a copy of the dockerfiles from the Github repo linked above and launch the Terminal to the chrome/stable directory.

build

Enter sudo docker build -t chrome . and hit enter.

buildcomplete

The dockerfile should successfully complete the build.

run

Enter sudo docker run -it –net host –cpuset-cpus 0 –memory 512mb -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY -v $HOME/Downloads:/root/Downloads -v $HOME/.config/google-chrome/:/data –device /dev/snd –name chrome jess/chrome and hit enter.

A really fun and simple example is Tetris, though it’s not a very visually impactful choice! To play with that, open the Terminal to the Tetris folder.

Enter: docker build -t tetris .  and hit enter.

Enter docker run -it tetris and hit enter.

Conclusion

While you can containerize desktop applications with Docker, I have found it a little challenging. I have had much more success when running the containers on a physical desktop with Debian. Not just Jessie’s applications but most others I have found out there too.

It seems like depending on the source, a container may not work well with a different kernel. The majority of containers I have tried have not worked on a virtual machine at all. Many have failed to run on Windows or OS X. Obviously, Docker is a Linux based product and as most know, Linux is not a big player in the desktop game. I feel Turbo containers are a better fit for me as somebody who works primarily with desktop applications.

About author

Rorymon

Microsoft MVP in App-V. Citrix CTA. VMware vExpert. Unidesk Certified Engineer