Migrated to Ubuntu:18.10 and Java installation via SDKMan. Fixes gh-754

This commit is contained in:
Marcin Grzejszczak
2018-10-19 16:14:12 +02:00
parent 1ccb884cf8
commit 34c2ed0330
11 changed files with 84 additions and 5 deletions

View File

@@ -1,7 +1,25 @@
FROM anapsix/alpine-java:8_jdk
FROM ubuntu:18.10
ARG SDKMAN_JAVA_INSTALLATION=8.0.181-zulu
MAINTAINER Marcin Grzejszczak <mgrzejszczak@pivotal.io>
RUN apt-get update && apt-get install -y curl \
unzip \
zip \
&& apt-get clean
# Install sdkman and java
RUN curl -s get.sdkman.io | bash
COPY sdkman.config /.sdkman/etc/config
COPY sdkman/ /usr/local/bin/
RUN /bin/bash -c "chmod +x /usr/local/bin/sdkman-exec.sh && chmod +x /usr/local/bin/sdkman-wrapper.sh && chmod +x /root/.sdkman/bin/sdkman-init.sh"
RUN /bin/bash -c "source /root/.sdkman/bin/sdkman-init.sh"
RUN sdkman-wrapper.sh install java "${SDKMAN_JAVA_INSTALLATION}"
ENV JAVA_HOME /root/.sdkman/candidates/java/current/
ENV PATH "${PATH}:${JAVA_HOME}/bin"
# Spring Cloud Contract
COPY project /spring-cloud-contract/
WORKDIR /spring-cloud-contract/
# Let's copy the downloaded deps to .m2 and the gradle cache

View File

@@ -2,7 +2,7 @@
set -e
WRAPPER_VERSION="4.4.1"
WRAPPER_VERSION="4.10.2"
GRADLE_BIN_DIR="gradle-${WRAPPER_VERSION}-bin"
GRADLE_WRAPPER_DIR="${HOME}/.gradle/wrapper/dists/${GRADLE_BIN_DIR}"
CURRENT_DIR="$( pwd )"

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip

View File

@@ -0,0 +1,8 @@
# make gvm non-interactive, great for CI environments
sdkman_auto_answer=true
# don't prompt user to selfupdate on new shell
sdkman_suggestive_selfupdate=false
# don't perform automatic selfupdates
sdkman_auto_selfupdate=false

View File

@@ -0,0 +1,7 @@
#!/bin/bash
# A quick wrapper to source the gvm env and run a command
# This is used to run sdkman in Dockerfile RUN commands
# since the RUN commands does not use interactive shells
[[ -s "/root/.sdkman/bin/sdkman-init.sh" ]] && source "/root/.sdkman/bin/sdkman-init.sh" && exec "$@"

View File

@@ -0,0 +1,7 @@
#!/bin/bash
# A quick wrapper to source the gvm env and run it
# This is used to run gvm in Dockerfile RUN commands
# since the RUN commands does not use interactive shells
[[ -s "/root/.sdkman/bin/sdkman-init.sh" ]] && source "/root/.sdkman/bin/sdkman-init.sh" && sdk $@

View File

@@ -1,9 +1,26 @@
FROM anapsix/alpine-java:8_jdk
FROM ubuntu:18.10
ARG SDKMAN_JAVA_INSTALLATION=8.0.181-zulu
MAINTAINER Marcin Grzejszczak <mgrzejszczak@pivotal.io>
ENV SERVER_PORT 8083
RUN apt-get update && apt-get install -y curl \
unzip \
zip \
&& apt-get clean
# Install sdkman and java
RUN curl -s get.sdkman.io | bash
COPY sdkman.config /.sdkman/etc/config
COPY sdkman/ /usr/local/bin/
RUN /bin/bash -c "chmod +x /usr/local/bin/sdkman-exec.sh && chmod +x /usr/local/bin/sdkman-wrapper.sh && chmod +x /root/.sdkman/bin/sdkman-init.sh"
RUN /bin/bash -c "source /root/.sdkman/bin/sdkman-init.sh"
RUN sdkman-wrapper.sh install java "${SDKMAN_JAVA_INSTALLATION}"
ENV JAVA_HOME /root/.sdkman/candidates/java/current/
ENV PATH "${PATH}:${JAVA_HOME}/bin"
# Spring Cloud Contract
ENV SERVER_PORT 8083
VOLUME /tmp
ADD target/libs/stub-runner-boot.jar stub-runner-boot.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/stub-runner-boot.jar"]

View File

@@ -0,0 +1,8 @@
# make gvm non-interactive, great for CI environments
sdkman_auto_answer=true
# don't prompt user to selfupdate on new shell
sdkman_suggestive_selfupdate=false
# don't perform automatic selfupdates
sdkman_auto_selfupdate=false

View File

@@ -0,0 +1,7 @@
#!/bin/bash
# A quick wrapper to source the gvm env and run a command
# This is used to run sdkman in Dockerfile RUN commands
# since the RUN commands does not use interactive shells
[[ -s "/root/.sdkman/bin/sdkman-init.sh" ]] && source "/root/.sdkman/bin/sdkman-init.sh" && exec "$@"

View File

@@ -0,0 +1,7 @@
#!/bin/bash
# A quick wrapper to source the gvm env and run it
# This is used to run gvm in Dockerfile RUN commands
# since the RUN commands does not use interactive shells
[[ -s "/root/.sdkman/bin/sdkman-init.sh" ]] && source "/root/.sdkman/bin/sdkman-init.sh" && sdk $@