Some further docker image steps

This commit is contained in:
Mirco 2024-06-20 15:09:08 +02:00
parent 8ae0416f0c
commit a0691894ac
4 changed files with 19 additions and 21 deletions

View file

@ -60,6 +60,8 @@ java {
graalvmNative {
binaries {
main {
mainClass = 'com.ModeratoElection.MEApplication'
fallback = false
imageName.set('ModeratorElection')
javaLauncher.set(javaToolchains.launcherFor {
languageVersion.set(JavaLanguageVersion.of(17))

View file

@ -16,7 +16,7 @@ def initialize(project):
input = {
"name": name,
"module": "notused",
"module": "vaadin_fullstack",
"stage": "notused",
"project_root_path": PROJECT_ROOT_PATH,
"build_types": ["IMAGE"],

View file

@ -1,6 +1,7 @@
#Build Stage
FROM node:22.3.0-bookworm-slim
FROM ubuntu:noble-20240605
ADD resources /tmp
RUN /tmp/install.sh
ENV LANG=en_US.UTF-8 \
JAVA_HOME=/usr/lib/jvm/graalvm

View file

@ -10,7 +10,6 @@ function main()
mkdir /usr/local/src/ModeratorElection
#change to main branch for production
git clone --single-branch --branch MEapp-development https://repo.prod.meissa.de/meissa/ModeratorElection.git /usr/local/src/ModeratorElection
#cp /tmp/MEMBERNAMES /usr/local/src/ModeratorElection
#download gradle
#gradle_version="8.4"
@ -28,26 +27,24 @@ function main()
#curl -SsLo /tmp/graalvm-community-jdk.tar.gz https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-${graalvm_jdk_version}/graalvm-community-jdk-${graalvm_jdk_version}_linux-x64_bin.tar.gz
#curl -SsLo /tmp/graalvm-checksum https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-${graalvm_jdk_version}/graalvm-community-jdk-${graalvm_jdk_version}_linux-x64_bin.tar.gz.sha256
#checksum gradle, graalvm
#checksum graalvm
checksum
#install gradle
#mkdir /opt/gradle
#unzip -qqd /opt/gradle /tmp/gradle-${gradle_version}-bin.zip
#export PATH=$PATH:/opt/gradle/gradle-${gradle_version}/bin
#install graalvm -- ToDo: need to be checked, graalvm after installing available as default-jvm?
tar -C /usr/lib/jvm/ -xzf graalvm-jdk-${graalvm_JDK_version}_linux-x64_bin.tar.gz
#install graalvm
mkdir /usr/lib/jvm/
tar -C /usr/lib/jvm/ -xzf /tmp/graalvm-jdk-${graalvm_JDK_version}_linux-x64_bin.tar.gz
dirname_graalvm=$(ls /usr/lib/jvm/|grep -e graa)
ln -s /usr/lib/jvm/$dirname_graalvm /usr/lib/jvm/graalvm
ln -s /usr/lib/jvm/graalvm/bin/gu /usr/local/bin
update-alternatives --install /usr/bin/java java /usr/lib/jvm/graalvm/bin/java 2
update-alternatives --install /usr/bin/java java /usr/lib/jvm/graalvm/bin/java 0
echo "export PATH=$PATH:/usr/lib/jvm/$dirname_graalvm/lib/svm/bin"|tee -a /root/.bashrc
#possibility to install js, node.js,... to graalvm using "gu"
#"gu available" shows available components, native-image is one part of it
echo "export PATH=$PATH:/usr/lib/jvm/graalvm-jdk-17.0.11+7.1/lib/installer/bin/gu"|tee -a /root/.bashrc
/usr/lib/jvm/$dirname_graalvm/lib/svm/bin/native-image --version
#ToDo install by graalvm, put graalvm binary here
#install -m 0700 /tmp/entrypoint-start-and-wait.sh /
#install -m 0700 /tmp/init.sh /usr/local/bin/
#install -m 0700 /tmp/backup.sh /usr/local/bin/
#install -m 0700 /tmp/restore.sh /usr/local/bin/
@ -57,13 +54,9 @@ function main()
} #> /dev/null
function checksum() {
#gradle
#echo " /tmp/gradle-${gradle_version}-bin.zip"|tee -a /tmp/gradle-${gradle_version}-bin.zip.sha256
#sha256sum -c --status /tmp/gradle-${gradle_version}-bin.zip.sha256
#graalvm
echo " /tmp/graalvm-jdk-${graalvm_JDK_version}_linux-x64_bin.tar.gz"|tee -a /tmp/graalvm-jdk-${graalvm_JDK_version}_linux-x64_bin.tar.gz.sha256
sha256sum -c --status graalvm-jdk-${graalvm_JDK_version}_linux-x64_bin.tar.gz.sha256
sha256sum -c --status /tmp/graalvm-jdk-${graalvm_JDK_version}_linux-x64_bin.tar.gz.sha256
}
source /tmp/install_functions_debian.sh
@ -74,3 +67,5 @@ DEBIAN_FRONTEND=noninteractive DEBCONF_NOWARNINGS=yes main
#npm audit fix
#npm ci --omit=dev
#./gradlew build
cd /usr/local/src/ModeratorElection/
./gradlew clean build -Pvaadin.productionMode -x processTestAot