# s2i-gradle-kbs
|
## ATTENTION ##
|
# This is a demo, do not use for anything else.
|
# no warranty, if it breaks your systems, you have to keep the pieces.
|
# Olaf Bohlen, obohlen@redhat.com, 2022-11-30
|
FROM registry.access.redhat.com/ubi9
|
|
# TODO: Put the maintainer name in the image metadata
|
LABEL maintainer="Olaf Bohlen <obohlen@redhat.com>"
|
|
# TODO: Rename the builder environment variable to inform users about application you provide them
|
ENV BUILDER_VERSION 0.1 \
|
PATH=${PATH}:/opt/gradle/gradle-7.6/bin
|
|
# TODO: Set labels used in OpenShift to describe the builder image
|
LABEL io.k8s.description="Platform for building springboot with Gradle" \
|
io.k8s.display-name="builder 0.1.0" \
|
io.openshift.expose-services="8080:http" \
|
io.openshift.tags="builder,jee,java,gradle"
|
|
# TODO: Install required packages here:
|
# RUN yum install -y ... && yum clean all -y
|
RUN yum install -y java-11-openjdk unzip && \
|
yum clean all -y && \
|
mkdir -p /opt/gradle /opt/app-root /opt/app-src && \
|
cd /opt/gradle && \
|
curl -o /tmp/gradle.zip https://downloads.gradle-dn.com/distributions/gradle-7.6-bin.zip && \
|
unzip -d /opt/gradle /tmp/gradle.zip && \
|
chown -R 1001:1001 /opt/app-root && \
|
chown -R 1001:0 /opt/app-src
|
|
# TODO: Copy the S2I scripts to /usr/libexec/s2i, since openshift/base-centos7 image
|
# sets io.openshift.s2i.scripts-url label that way, or update that label
|
COPY ./s2i/bin/ /usr/libexec/s2i
|
|
# This default user is created in the openshift/base-centos7 image
|
USER 1001
|
|
# TODO: Set the default port for applications built using this image
|
EXPOSE 8080
|
|
# TODO: Set the default CMD for the image
|
CMD ["/usr/libexec/s2i/usage"]
|