forked from batmat/docker-eclipse
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
62 lines (49 loc) · 2.44 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
FROM ubuntu
MAINTAINER Joerg Matysiak
# Please adjust values of USERNAME, uid and gid if needed
ENV USERNAME developer
# Replace 1000 with your user / group id
RUN export uid=1000 gid=1000 && \
mkdir -p /home/$USERNAME && \
echo "$USERNAME:x:${uid}:${gid}:Developer,,,:/home/$USERNAME:/bin/bash" >> /etc/passwd && \
echo "$USERNAME:x:${uid}:" >> /etc/group && \
echo "$USERNAME ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$USERNAME && \
chmod 0440 /etc/sudoers.d/$USERNAME && \
chown ${uid}:${gid} -R /home/$USERNAME
USER $USERNAME
ENV HOME /home/$USERNAME
WORKDIR $HOME
# Install missing packages
RUN sudo apt-get update && \
sudo apt-get install libswt-gtk-3-java \
unzip ant ant-contrib git git-svn \
bash-completion curl software-properties-common wget \
maven -y && \
sudo apt-get clean
# Install oracle jdks 6,7 and 8
RUN sudo apt-add-repository ppa:webupd8team/java && \
sudo apt-get update && \
echo oracle-java6-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections && \
echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections && \
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections && \
sudo apt-get install oracle-java6-installer \
oracle-java7-installer \
oracle-java8-installer -y && \
sudo apt-get clean
# Install latest gradle
ENV GRADLE_DOWNLOAD_LINK https://services.gradle.org/distributions/gradle-2.4-all.zip
RUN curl -L -o gradle.zip $GRADLE_DOWNLOAD_LINK && \
sudo unzip gradle.zip -d /opt && \
rm gradle.zip && \
sudo update-alternatives --install /usr/bin/gradle gradle /opt/gradle*/bin/gradle 100
# copy eclipse install tools to image
ENV ECLIPSE_BASE_DIR /opt
ENV ECLIPSE_INST_TOOL /opt/eclipse_install_tools/install_eclipse.sh
ADD eclipse_install_tools/ /opt/eclipse_install_tools/
RUN sudo chmod 755 $ECLIPSE_INST_TOOL
# Install eclipse
RUN sudo mkdir -p $ECLIPSE_BASE_DIR/eclipse && sudo chown $USERNAME:$USERNAME $ECLIPSE_BASE_DIR/eclipse
RUN $ECLIPSE_INST_TOOL -y -t $ECLIPSE_BASE_DIR -p egit,findbugs,checkstyle,databaseviewer,bndtools,ds_annotation_builder,mat -d quickrex
RUN sudo update-alternatives --install /usr/bin/eclipse eclipse $ECLIPSE_BASE_DIR/eclipse/eclipse 100
# Eclipse is the default tool to start in this docker container
CMD $ECLIPSE_BASE_DIR/eclipse/eclipse