build: Use ubi as default based image for che-server build (#262)
* Use ubi as default based image for che-server build * Set strict java 11 version Co-authored-by: Michal Vala <michal.vala@gmail.com>pull/265/head
parent
470e5b86be
commit
d09cb9767d
|
|
@ -20,17 +20,11 @@ jobs:
|
|||
fetch-depth: 0
|
||||
- name: Check all properties have description
|
||||
run: ./check_properties_description.sh
|
||||
- name: Cache local Maven repository
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: 'adopt'
|
||||
java-version: '11.0.11+9'
|
||||
distribution: 'temurin'
|
||||
java-version: '11.0.14'
|
||||
cache: 'maven'
|
||||
- name: Build with Maven
|
||||
run: mvn -B clean install -U -Pintegration
|
||||
|
|
|
|||
|
|
@ -22,18 +22,12 @@ jobs:
|
|||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Cache local Maven repository
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: 'adopt'
|
||||
java-version: '11.0.11+9'
|
||||
distribution: 'temurin'
|
||||
java-version: '11.0.14'
|
||||
cache: 'maven'
|
||||
- name: Login to docker.io
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
|
|
@ -67,14 +61,6 @@ jobs:
|
|||
|
||||
docker push quay.io/eclipse/che-server:next
|
||||
docker push quay.io/eclipse/che-server:${{ steps.build.outputs.short_sha1 }}
|
||||
- name: Build ubi8 Che Server image
|
||||
run: |
|
||||
./dockerfiles/che/build.sh --dockerfile:"rhel.Dockerfile" --tag:"rhel-next"
|
||||
docker tag quay.io/eclipse/che-server:rhel-next quay.io/eclipse/che-server:rhel-${{ steps.build.outputs.short_sha1 }}
|
||||
- name: Push ubi8 Che Server image
|
||||
run: |
|
||||
docker push quay.io/eclipse/che-server:rhel-next
|
||||
docker push quay.io/eclipse/che-server:rhel-${{ steps.build.outputs.short_sha1 }}
|
||||
- name: Create failure MM message
|
||||
if: ${{ failure() }}
|
||||
run: |
|
||||
|
|
|
|||
|
|
@ -81,8 +81,9 @@ jobs:
|
|||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: 'adopt'
|
||||
java-version: '11.0.11+9'
|
||||
distribution: 'temurin'
|
||||
java-version: '11.0.14'
|
||||
cache: 'maven'
|
||||
- name: Set up environment
|
||||
run: |
|
||||
sudo apt-get update -y || true
|
||||
|
|
|
|||
|
|
@ -14,20 +14,15 @@ jobs:
|
|||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: 'adopt'
|
||||
java-version: '11.0.11+9'
|
||||
distribution: 'temurin'
|
||||
java-version: '11.0.14'
|
||||
cache: 'maven'
|
||||
- name: Cache SonarCloud packages
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.sonar/cache
|
||||
key: ${{ runner.os }}-sonar
|
||||
restore-keys: ${{ runner.os }}-sonar
|
||||
- name: Cache Maven packages
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.m2
|
||||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: ${{ runner.os }}-m2
|
||||
- name: Build and analyze
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
|
||||
|
|
|
|||
|
|
@ -1,18 +1,37 @@
|
|||
# Copyright (c) 2012-2019 Red Hat, Inc.
|
||||
# Copyright (c) 2018-2022 Red Hat, Inc.
|
||||
# This program and the accompanying materials are made
|
||||
# available under the terms of the Eclipse Public License 2.0
|
||||
# which is available at https://www.eclipse.org/legal/epl-2.0/
|
||||
#
|
||||
# SPDX-License-Identifier: EPL-2.0
|
||||
#
|
||||
# Contributors:
|
||||
# Red Hat, Inc. - initial API and implementation
|
||||
#
|
||||
|
||||
FROM docker.io/adoptopenjdk/openjdk11:jre-11.0.11_9
|
||||
ENV LANG=C.UTF-8
|
||||
RUN echo "%root ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && rm -rf /tmp/*
|
||||
EXPOSE 8000 8080
|
||||
# https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi8-minimal
|
||||
FROM registry.access.redhat.com/ubi8-minimal:8.5-230
|
||||
USER root
|
||||
ENV CHE_HOME=/home/user/eclipse-che
|
||||
ENV JAVA_HOME=/usr/lib/jvm/jre
|
||||
RUN microdnf install java-11-openjdk-headless-1:11.0.14.0.9-2.el8_5.x86_64 tar gzip shadow-utils findutils && \
|
||||
microdnf update -y gnutls && \
|
||||
microdnf -y clean all && rm -rf /var/cache/yum && echo "Installed Packages" && rpm -qa | sort -V && echo "End Of Installed Packages" && \
|
||||
adduser -G root user && mkdir -p /home/user/eclipse-che
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
RUN mkdir /logs /data && \
|
||||
chmod 0777 /logs /data
|
||||
|
||||
ADD eclipse-che /home/user/eclipse-che
|
||||
RUN find /home/user -type d -exec chmod 777 {} \;
|
||||
# this should fail if the startup script is not found in correct path /home/user/eclipse-che/tomcat/bin/catalina.sh
|
||||
RUN mkdir /logs /data && \
|
||||
chmod 0777 /logs /data && \
|
||||
chgrp -R 0 /home/user /logs /data && \
|
||||
chown -R user /home/user && \
|
||||
chmod -R g+rwX /home/user && \
|
||||
find /home/user -type d -exec chmod 777 {} \; && \
|
||||
java -version && echo -n "Server startup script in: " && \
|
||||
find /home/user/eclipse-che -name catalina.sh | grep -z /home/user/eclipse-che/tomcat/bin/catalina.sh
|
||||
|
||||
USER user
|
||||
|
||||
# append Brew metadata here
|
||||
|
|
|
|||
|
|
@ -1,37 +0,0 @@
|
|||
# Copyright (c) 2018-2020 Red Hat, Inc.
|
||||
# This program and the accompanying materials are made
|
||||
# available under the terms of the Eclipse Public License 2.0
|
||||
# which is available at https://www.eclipse.org/legal/epl-2.0/
|
||||
#
|
||||
# SPDX-License-Identifier: EPL-2.0
|
||||
#
|
||||
# Contributors:
|
||||
# Red Hat, Inc. - initial API and implementation
|
||||
#
|
||||
|
||||
# https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi8-minimal
|
||||
FROM registry.access.redhat.com/ubi8-minimal:8.5-230
|
||||
USER root
|
||||
ENV CHE_HOME=/home/user/eclipse-che
|
||||
ENV JAVA_HOME=/usr/lib/jvm/jre
|
||||
RUN microdnf install java-11-openjdk-headless tar gzip shadow-utils findutils && \
|
||||
microdnf update -y gnutls && \
|
||||
microdnf -y clean all && rm -rf /var/cache/yum && echo "Installed Packages" && rpm -qa | sort -V && echo "End Of Installed Packages" && \
|
||||
adduser -G root user && mkdir -p /home/user/eclipse-che
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
ADD eclipse-che /home/user/eclipse-che
|
||||
# this should fail if the startup script is not found in correct path /home/user/eclipse-che/tomcat/bin/catalina.sh
|
||||
RUN mkdir /logs /data && \
|
||||
chmod 0777 /logs /data && \
|
||||
chgrp -R 0 /home/user /logs /data && \
|
||||
chown -R user /home/user && \
|
||||
chmod -R g+rwX /home/user && \
|
||||
find /home/user -type d -exec chmod 777 {} \; && \
|
||||
java -version && echo -n "Server startup script in: " && \
|
||||
find /home/user/eclipse-che -name catalina.sh | grep -z /home/user/eclipse-che/tomcat/bin/catalina.sh
|
||||
|
||||
USER user
|
||||
|
||||
# append Brew metadata here
|
||||
Loading…
Reference in New Issue