Skip to content

Instantly share code, notes, and snippets.

@fbarriga
Last active January 20, 2017 20:44
Show Gist options
  • Save fbarriga/21eeecbf71ca00b78962fc4c70a33d86 to your computer and use it in GitHub Desktop.
Save fbarriga/21eeecbf71ca00b78962fc4c70a33d86 to your computer and use it in GitHub Desktop.
docker dev env for mate using openSuse.

Usage:

1.- Create docker image:

$ docker build -t mate-opensuse .

2.- Execute image:

$ docker run --rm -v ~/repos:/home/developer/repos -t mate-opensuse

3.- Connect using VNC:

# replace with the ip of the docker instance
$ gvncviewer 172.17.0.2

4.- Start mate-session

Once you have connected to the docker instance using vnc, an X11 desktop with xterm will appear. Just execute:

$ mate-session

5.- Now you have an env where you can clone mate repos and compile them. If you have missing dependencies, try installing them using zypper source-install xxx. e.g.:

# zypper source-install caja-extensions
FROM opensuse:tumbleweed
MAINTAINER Felipe Barriga Richards <felipe at felipebarriga.cl>
RUN echo "commit.downloadMode = DownloadInAdvance" >> /etc/zypp/zypp.conf && \
zypper --non-interactive update && \
zypper --non-interactive install sudo xorg-x11-server-extra xterm x11vnc xvfb-run iproute2 twm && \
zypper --non-interactive install git nano man && \
zypper --non-interactive install -t pattern devel_C_C++ && \
zypper --non-interactive addrepo --no-gpgcheck http://download.opensuse.org/repositories/X11:/MATE:/Next/openSUSE_Factory/ mate:next
RUN zypper --non-interactive install \
`zypper search --repo mate:next | grep -v "caja-extension-share" | grep -v "openSUSE" | grep "| package" | cut -d' ' -f 4 | tr '\n' ' '`
RUN zypper --non-interactive source-install caja-extensions marco mate-panel
EXPOSE 5900
RUN useradd -U -m developer && \
echo "developer ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/developer && \
chmod 0440 /etc/sudoers.d/developer
USER developer
WORKDIR /home/developer
CMD echo "VNC server listening on `hostname -I` port 5900" && \
x11vnc -forever -nopw -create
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment