Skip to content
Snippets Groups Projects
Commit 41075f12 authored by Benedikt's avatar Benedikt
Browse files

Use openshift base image

parent 55eafc07
No related branches found
No related tags found
No related merge requests found
......@@ -3,18 +3,18 @@
# This image provide a base for running Spring Boot based applications. It
# provides a base Java 8 installation and Maven 3.
FROM centos:centos7
FROM openshift/base-centos7
# Location of the STI scripts inside the image
#
LABEL io.openshift.s2i.scripts-url=image:///usr/libexec/s2i
# Path to be used in other layers to place s2i scripts into
ENV STI_SCRIPTS_PATH=/usr/libexec/s2i
EXPOSE 8080
ENV JAVA_VERSON 1.8.0
ENV MAVEN_VERSION 3.3.9
LABEL io.k8s.description="Platform for building and running Spring Boot applications" \
io.k8s.display-name="Spring Boot Maven 3" \
io.openshift.expose-services="8080:http" \
io.openshift.tags="builder,java,java8,maven,maven3,springboot"
RUN yum update -y && \
yum install -y curl && \
yum install -y java-$JAVA_VERSON-openjdk java-$JAVA_VERSON-openjdk-devel && \
......@@ -28,30 +28,9 @@ ENV JAVA_HOME /usr/lib/jvm/java
ENV MAVEN_HOME /usr/share/maven
# Add configuration files, bashrc and other tweaks
ADD ./s2i/bin/ $STI_SCRIPTS_PATH
# Create 'ruby' account we will use to run Ruby application
# Add support for '#!/usr/bin/ruby' shebang.
RUN mkdir -p /opt/java/src && \
groupadd -r java -f -g 433 && \
useradd -u 431 -r -g java -d /opt/java -s /sbin/nologin -c "Java user" java && \
chown -R java:java /opt/java
COPY ./s2i/bin/ $STI_SCRIPTS_PATH
# Set the 'root' directory for this build
#
# This can be overridden inside another Dockerfile that uses this image as a base
# image or in STI via the '-e "APP_ROOT=subdir"' option.
#
# Use this in case when your application is contained in a subfolder of your
# GIT repository. The default value is the root folder.
ENV APP_ROOT .
ENV HOME /opt/java
ENV PATH $HOME/bin:$PATH
WORKDIR /opt/java/src
USER java
EXPOSE 8080
USER default
# Set the default CMD to print the usage of the language image
CMD $STI_SCRIPTS_PATH/usage
......@@ -7,8 +7,8 @@ of the base image for deploying Spring Boot applications as reproducible Docker
images. The resulting images can be run either by [Docker](http://docker.io)
or using [S2I](https://github.com/openshift/source-to-image).
This image is heavily inspired by the awesome [openshift/ruby-20-centos](https://github.com/openshift/ruby-20-centos/)
builder image.
This image is heavily inspired by the awesome [openshift/sti-ruby](https://github.com/openshift/sti-ruby/),
builder images.
Installation
---------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment