Run Github's Atom editor in Docker (Aka. Containers on the desktop)

By now everybody loves Docker. I mean, what is there not to love? Never have it been easier to program, pack and deploy you're applications and getting out of dependency hell while keeping them isolated from each other.
Docker has solved the whole "download and install this on the server, but remember to have the right version of Java (no, not that one!) and Tomcat (7, not 8)" - problem. All servers are happy.

A couple of months ago I read a blogpost by the talented Docker engineer Jessie Frazelle who has made a large collection of Docker images for the desktop.
The FREAKING desktop. To quote Jessie:

Feeling inspired by this crazy lady I decided to try it out myself. So here is a Dockerfile for the Atom editor you can run on you're Linux desktop (because, why the hell not?)


# Based on work by Jessie Frazelle,
FROM ubuntu:14.04
MAINTAINER Andreas Mosti <>

RUN apt-get update && apt-get install -y \
    build-essential \
    ca-certificates \
    curl \
    git \
    libasound2 \
    libgconf-2-4 \
    libgnome-keyring-dev \
    libgtk2.0-0 \
    libnss3 \
    libxtst6 \

RUN curl -sL | bash -
RUN apt-get install -y nodejs

RUN git clone /src
RUN git fetch && git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
RUN script/build && script/grunt install

# set up user and permission
RUN export uid=1000 gid=1000 && \
    mkdir -p /home/developer && \
    echo "developer:x:${uid}:${gid}:Developer,,,:/home/developer:/bin/bash" >> /etc/passwd && \
    echo "developer:x:${uid}:" >> /etc/group && \
    echo "developer ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/developer && \
    chmod 0440 /etc/sudoers.d/developer && \
    chown ${uid}:${gid} -R /home/developer

USER developer
ENV HOME /home/developer

# get my configfiles from github
RUN mkdir .atom &&  \ 
git clone && \ 
cd dotfiles/atom; ./configureAtom

CMD /usr/local/bin/atom --foreground --log-file /var/log/atom.log && tail -f /var/log/atom.log

Build and run

docker build -t atom
docker run -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY atom

Another cool thing we can do is to attach a data container with the
--volumes-from= flag. Here is how to build a data container from a git-repo and attach:

docker run --name coffee -e repo= -t andmos/git
docker run --volumes-from:coffee -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY atom

open /var/workspace/coffee and there is the repo!

This image has lots of possibilities - happy hacking!