Skip to content

Commit 42aa691

Browse files
committed
Integrate now Idea IntelliJ to develop directly from the docker container
Groovy is also installed from the project web site
1 parent 93ea78b commit 42aa691

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

Dockerfile

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ ARG MAVEN_VERSION=3.6.3
2121
ARG MAVEN_SHA=c35a1803a6e70a126e80b2b3ae33eed961f83ed74d18fcd16909b2d44d7dada3203f1ffe726c17ef8dcca2dcaa9fca676987befeadc9b9f759967a8cb77181c0
2222
ARG WILDFLY_VERSION=20.0.1
2323
ARG JAVA_VERSION=11
24+
ARG IDEA_VERSION=2020.3.1
25+
ARG GROOVY_VERSION=3.0.7
2426

2527
# Because the source code is shared between the host and the container, it is required the identifier
2628
# of the owner and of its group are the same between this two environments. By default, they are both set at 1000.
@@ -56,10 +58,10 @@ RUN apt-get update && apt-get install -y \
5658
libreoffice-calc \
5759
libreoffice-impress \
5860
gpgv \
59-
groovy \
61+
libgbm1 \
6062
&& groupadd -g ${GROUP_ID} silveruser \
6163
&& useradd -u ${USER_ID} -g ${GROUP_ID} -G users -d /home/silveruser -s /bin/bash -m silveruser \
62-
&& curl -sL https://deb.nodesource.com/setup_10.x | bash - \
64+
&& curl -sL https://deb.nodesource.com/setup_14.x | bash - \
6365
&& apt-get install -y nodejs \
6466
&& rm -rf /var/lib/apt/lists/* \
6567
&& update-ca-certificates -f \
@@ -71,6 +73,15 @@ RUN apt-get update && apt-get install -y \
7173
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn \
7274
&& unzip /tmp/maven-deps.zip -d /home/silveruser/ \
7375
&& chown -R silveruser:silveruser /home/silveruser/.m2 \
76+
&& curl -fsSL -o /tmp/apache-groovy.zip https://dl.bintray.com/groovy/maven/apache-groovy-binary-${GROOVY_VERSION}.zip \
77+
&& unzip /tmp/apache-groovy.zip -d /opt/ \
78+
&& echo `grep -oP '(?<=")[a-zA-Z:/]+(?=")' /etc/environment`:/opt/groovy-{GROOVY_VERSION}/bin > /etc/environment \
79+
&& curl -fsSL -o /tmp/ideaIU.tar.gz https://download.jetbrains.com/idea/ideaIU-${IDEA_VERSION}.tar.gz \
80+
&& tar -xzf /tmp/ideaIU.tar.gz -C /home/silveruser/ \
81+
&& mkdir /home/silveruser/bin \
82+
&& echo "PATH=${PATH}:/home/silveruser/bin" >> /home/silveruser/.bashrc \
83+
&& ln -s /home/silveruser/idea*/bin/idea.sh /home/silveruser/bin/idea \
84+
&& rm -f /tmp/ideaIU.tar.gz \
7485
&& curl -fsSL -o /tmp/swftools-bin-0.9.2.zip https://www.silverpeas.org/files/swftools-bin-0.9.2.zip \
7586
&& echo 'd40bd091c84bde2872f2733a3c767b3a686c8e8477a3af3a96ef347cf05c5e43 *swftools-bin-0.9.2.zip' | sha256sum - \
7687
&& unzip /tmp/swftools-bin-0.9.2.zip -d / \
@@ -95,16 +106,15 @@ COPY src/bash_aliases /home/silveruser/.bash_aliases
95106
COPY src/settings.xml /home/silveruser/.m2/
96107
COPY src/git_completion_profile /home/silveruser/.git_completion_profile
97108

98-
RUN chown silveruser:silveruser /home/silveruser/.inputrc \
99-
&& chown silveruser:silveruser /home/silveruser/.m2/settings.xml \
100-
&& chown silveruser:silveruser /home/silveruser/.git_completion_profile \
109+
RUN chown -R silveruser:silveruser /home/silveruser \
101110
&& echo "if [ -f .git_completion_profile ]; then\n . ~/.git_completion_profile\nfi" >> /home/silveruser/.bashrc
102111

103112
ENV LANG ${DEFAULT_LOCALE}
104113
ENV LANGUAGE ${DEFAULT_LOCALE}
105114
ENV LC_ALL ${DEFAULT_LOCALE}
106115
ENV MAVEN_HOME /usr/share/maven
107116
ENV JAVA_HOME /usr/lib/jvm/java-${JAVA_VERSION}-openjdk-amd64
117+
ENV GROOVY_HOME /opt/groovy-${GROOVY_VERSION}
108118

109119
# By default, the build will be done in the default user's home directory
110120
USER silveruser

run.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ if [[ -f "$HOME"/.m2/settings-docker.xml ]]; then
6262
else
6363
settings="$HOME"/.m2/settings.xml
6464
fi
65-
docker run -it ${working_dir} ${maven_repo} \
65+
66+
#xhost +si:localuser:$USER
67+
docker run -it -e DISPLAY=${DISPLAY} ${working_dir} ${maven_repo} \
68+
-v /tmp/.X11-unix:/tmp/.X11-unix \
6669
-v "${settings}":/home/silveruser/.m2/settings.xml \
6770
-v "$HOME"/.m2/settings-security.xml:/home/silveruser/.m2/settings-security.xml \
6871
-v "$HOME"/.gitconfig:/home/silveruser/.gitconfig \

0 commit comments

Comments
 (0)