From 3e7c2389f0316114a1af1104d0dfbfab175f3ad4 Mon Sep 17 00:00:00 2001
From: Florent Gluck <florent.gluck@hesge.ch>
Date: Wed, 4 Sep 2024 17:45:18 +0200
Subject: [PATCH] Fixed issue with newer go version

---
 live_exam_os/Dockerfile          | 11 ++++++++++-
 live_exam_os/build_live_exam_iso |  3 ++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/live_exam_os/Dockerfile b/live_exam_os/Dockerfile
index a68b853d..98ab76c6 100644
--- a/live_exam_os/Dockerfile
+++ b/live_exam_os/Dockerfile
@@ -10,9 +10,18 @@ ARG cert
 ARG exam_user
 ARG exam_pwd
 
+RUN apt-get update && apt-get install -y gcc pkg-config git wget make ca-certificates libglfw3-dev libxcursor-dev libxinerama-dev libxi-dev libxxf86vm-dev upx-ucl
+
+# Install go 1.22 from the official GO site
+ENV archive=go1.22.6.linux-amd64.tar.gz
+ENV PATH=$PATH:/usr/local/go/bin
+WORKDIR /go
+RUN wget https://go.dev/dl/$archive
+RUN tar -C /usr/local -xzf $archive
+
+# Compile nexus-exam
 WORKDIR /nexus
 COPY ${base_dir} .
-RUN apt-get update && apt-get install -y golang-go make ca-certificates libglfw3-dev libxcursor-dev libxinerama-dev libxi-dev libxxf86vm-dev upx-ucl
 RUN make build_nexus-exam SERVER=${server_ip}:${server_port} CERT=${cert} EXAM_USER=${exam_user} EXAM_PWD=${exam_pwd}
 
 #--------------------------------------------------------------------------------------------------------------------
diff --git a/live_exam_os/build_live_exam_iso b/live_exam_os/build_live_exam_iso
index e36e73fc..b85da140 100755
--- a/live_exam_os/build_live_exam_iso
+++ b/live_exam_os/build_live_exam_iso
@@ -28,9 +28,10 @@ build_docker_image () {
     mkdir $dir || abort
     # Copy pub certificate
     cp $CERT $dir || abort
-    # Copy Makefile and sources files
+    # Copy Makefile, sources files and git files (as we insert the git commit hash into nexus-exam)
     cp ../Makefile $dir || abort
     cp -r ../src $dir || abort
+    cp -r ../.git $dir || abort
     cert_file=`basename $CERT`
 
     # build context is ".." since we need access to the ../src directory in order to build nexus-exam
-- 
GitLab