Skip to content

Commit

Permalink
feat(*): install SDKMAN! & use upgraded groovy lang
Browse files Browse the repository at this point in the history
  • Loading branch information
bentolor committed Apr 20, 2021
1 parent cce94f7 commit 419b803
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
18 changes: 11 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,27 @@ MAINTAINER Benjamin Schmid <[email protected]>
LABEL maintainer="Benjamin Schmid <[email protected]>"

# First install some basic tools to get them or their latest versions (wget, apt).
RUN apt-get update && apt-get install -y wget sudo locales groovy git && \
RUN apt-get update -q && apt-get install -q -y wget sudo locales zip unzip git && \
apt-get autoremove --purge -y && apt-get clean && \
rm /var/lib/apt/lists/*.* && rm -fr /tmp/* /var/tmp/*

# The default locale is POSIX which breaks UTF-8 based javac files
# NOTE:
# This only taked effect for user root. Check home/ideainspect/.bashrc for main user
# environment variables
RUN locale-gen en_US.UTF-8
RUN update-locale en_US.UTF8
RUN locale-gen en_US.UTF-8 && update-locale en_US.UTF8
ENV LANG "en_US.UTF-8"
ENV LC_MESSAGES "C"

# Provide a non-privileged user for running IntelliJ
RUN useradd -mUs /bin/bash ideainspect

# Install SDKMAN!
RUN sudo -u ideainspect sh -c 'curl -s "https://get.sdkman.io" | bash'

# Install Groovy Lang
RUN sudo -u ideainspect bash -ci 'shopt -s expand_aliases ; sdk install groovy'

# --------------- Install Oracle Java PPAs
#RUN echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee /etc/apt/sources.list.d/webupd8team-java.list
#RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
Expand Down Expand Up @@ -68,10 +76,6 @@ ENV LC_MESSAGES "C"
# rm /var/lib/apt/lists/*.* && \
# rm -fr /tmp/* /var/tmp/*


# Provide a non-privileged user for running IntelliJ
RUN useradd -mUs /bin/bash ideainspect

#
# Install IntelliJ IDEA
#
Expand Down
8 changes: 7 additions & 1 deletion home/ideainspect/.bashrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# Workaround: openjdk-Base image does not update links to /usr/lib/jvm/default-java/bin/java
export JAVA_HOME=/opt/java/openjdk/
export PATH=/opt/java/openjdk/bin:$PATH

# Point to IDEA installation directory
export ENV IDEA_HOME=/srv/idea.latest

# Language settings from Dockerfile. Adopt also for user bamboo
export LANG="en_US.UTF-8"
export LC_MESSAGES="C"
export LC_MESSAGES="C"

#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="/home/ideainspect/.sdkman"
[[ -s "/home/ideainspect/.sdkman/bin/sdkman-init.sh" ]] && source "/home/ideainspect/.sdkman/bin/sdkman-init.sh"

0 comments on commit 419b803

Please sign in to comment.