Skip to content

Commit

Permalink
Merge pull request #5 from stakater-docker/update-base
Browse files Browse the repository at this point in the history
Update base image
  • Loading branch information
hazim1093 authored Jan 17, 2019
2 parents c53947d + 7e4e23c commit b3a8a69
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 24 deletions.
33 changes: 10 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,14 @@
FROM stakater/pipeline-tools:v1.16.8
FROM stakater/pipeline-tools:v2.0.1

# Default to UTF-8 file.encoding
ENV LANG C.UTF-8

# add a simple script that can auto-detect the appropriate JAVA_HOME value
# based on whether the JDK or only the JRE is installed
RUN { \
echo '#!/bin/sh'; \
echo 'set -e'; \
echo; \
echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
} > /usr/local/bin/docker-java-home \
&& chmod +x /usr/local/bin/docker-java-home
ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk
ENV PATH $PATH:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin

ENV JAVA_HOME /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64
ENV PATH $PATH:${JAVA_HOME}/jre/bin:/usr/lib/jvm/${JAVA_HOME}/bin
ENV JAVA_VERSION 8u191
ENV JAVA_ALPINE_VERSION 8.191.12-r0

RUN set -x \
&& apk add --no-cache \
openjdk8="$JAVA_ALPINE_VERSION" \
&& [ "$JAVA_HOME" = "$(docker-java-home)" ]
ENV JAVA_YUM_VERSION 1.8.0.191.b12

# Changing user to root to install maven
USER root
RUN yum install -y java-1.8.0-openjdk-devel-${JAVA_YUM_VERSION}

# Setting Maven Version that needs to be installed
ARG MAVEN_VERSION=3.5.4
Expand All @@ -41,11 +25,14 @@ ENV MAVEN_VERSION=${MAVEN_VERSION} \
PATH=$M2:$PATH

# Add jenkins user with hardcoded ID (the one that jenkins expects)
RUN addgroup -g 233 docker && \
adduser -D -u 10000 -h /home/jenkins -G docker jenkins
RUN groupadd -g 233 docker && \
adduser -u 10000 -d /home/jenkins -g docker jenkins && \
passwd -d jenkins

# Change to jenkins user
USER jenkins

ENV HOME /home/jenkins

# Define default command, can be overriden by passing an argument when running the container
CMD ["mvn","-version"]
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

pushDockerImage {
dockerRepositoryURL = "docker.io"
imagePrefix = "3.5.4-jdk1.8-v1.16.8"
imagePrefix = "3.5.4-jdk1.8-v2.0.1"
}

0 comments on commit b3a8a69

Please sign in to comment.