Skip to content

Instantly share code, notes, and snippets.

@bathizte
Created June 1, 2016 18:24
Show Gist options
  • Save bathizte/92383393207408250dec6d8b3720c89a to your computer and use it in GitHub Desktop.
Save bathizte/92383393207408250dec6d8b3720c89a to your computer and use it in GitHub Desktop.
Dockerfile for https://www.coursera.org/learn/progfun1 : sbt and Intellij
#!/bin/sh
docker build -t bathizte/progfun-intellij .
FROM ubuntu:latest
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
apt-transport-https \
openjdk-8-jdk \
software-properties-common \
sudo \
wget
RUN java -version
RUN echo "deb https://dl.bintray.com/sbt/debian /" > /etc/apt/sources.list.d/sbt.list && \
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 642AC823 && \
apt-get update && \
apt-get install -y sbt
RUN wget https://download-cf.jetbrains.com/idea/ideaIC-2016.1.2b.tar.gz -O /tmp/intellij.tar.gz -q --show-progress --continue && \
echo 'Installing IntelliJ IDEA' && \
mkdir -p /opt/intellij && \
tar -xf /tmp/intellij.tar.gz --strip-components=1 -C /opt/intellij && \
rm /tmp/intellij.tar.gz
ADD ./run /usr/local/sbin/intellij
RUN chmod +x /usr/local/sbin/intellij && \
mkdir -p /home/developer && \
echo "developer:x:1000:1000:Developer,,,:/home/developer:/bin/bash" >> /etc/passwd && \
echo "developer:x:1000:" >> /etc/group && \
echo "developer ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/developer && \
chmod 0440 /etc/sudoers.d/developer && \
chown developer:developer -R /home/developer && \
chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo
USER developer
ENV HOME /home/developer
WORKDIR /home/developer
CMD /usr/local/sbin/intellij
#!/bin/sh
docker run -ti --rm \
--net=host \
--privileged=true \
-e DISPLAY=unix:0.0 \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v `pwd`:/home/developer \
bathizte/progfun-intellij
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment