From 6eeb2445e8c6dee6d325fc1aa72ae26732bd8ffa Mon Sep 17 00:00:00 2001 From: Ryan Kuba Date: Mon, 15 Apr 2024 18:16:38 +0000 Subject: [PATCH] Resolve KASM-5854 "Feature/ ubuntu noble" --- .gitlab-ci.yml | 38 +++++++++++++++ builder/dockerfile.ubuntu_noble.build | 28 +++++++++++ builder/dockerfile.ubuntu_noble.deb.build | 19 ++++++++ builder/dockerfile.ubuntu_noble.deb.test | 57 +++++++++++++++++++++++ builder/dockerfile.ubuntu_noble.test | 51 ++++++++++++++++++++ 5 files changed, 193 insertions(+) create mode 100644 builder/dockerfile.ubuntu_noble.build create mode 100644 builder/dockerfile.ubuntu_noble.deb.build create mode 100644 builder/dockerfile.ubuntu_noble.deb.test create mode 100644 builder/dockerfile.ubuntu_noble.test diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b382301..89cbb37 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -180,6 +180,44 @@ build_ubuntu_jammy_arm: paths: - output/ +build_ubuntu_noble: + stage: build + allow_failure: true + tags: + - oci-fixed-amd + before_script: + - *prepare_build + - *prepare_www + after_script: + - *prepare_artfacts + script: + - bash builder/build-package ubuntu noble; + only: + variables: + - $BUILD_JOBS == 'all' || $BUILD_JOBS =~ $CI_JOB_NAME + artifacts: + paths: + - output/ + +build_ubuntu_noble_arm: + stage: build + allow_failure: true + tags: + - oci-fixed-arm + before_script: + - *prepare_build + - *prepare_www + after_script: + - *prepare_artfacts + script: + - bash builder/build-package ubuntu noble; + only: + variables: + - $BUILD_JOBS == 'all' || $BUILD_JOBS =~ $CI_JOB_NAME + artifacts: + paths: + - output/ + build_debian_buster: stage: build allow_failure: true diff --git a/builder/dockerfile.ubuntu_noble.build b/builder/dockerfile.ubuntu_noble.build new file mode 100644 index 0000000..2375253 --- /dev/null +++ b/builder/dockerfile.ubuntu_noble.build @@ -0,0 +1,28 @@ +FROM ubuntu:noble + +ENV KASMVNC_BUILD_OS ubuntu +ENV KASMVNC_BUILD_OS_CODENAME noble +ENV XORG_VER 1.20.8 +ENV DEBIAN_FRONTEND noninteractive + +RUN sed -i 's$Types: deb$Types: deb deb-src$' /etc/apt/sources.list.d/ubuntu.sources + +RUN apt-get update && \ + apt-get -y install sudo + +RUN apt-get update && apt-get install -y --no-install-recommends tzdata +RUN apt-get update && apt-get -y build-dep xorg-server libxfont-dev +RUN apt-get update && apt-get -y install cmake git libgnutls28-dev vim wget curl +RUN apt-get update && apt-get -y install libpng-dev libtiff-dev libgif-dev libavcodec-dev libssl-dev libxrandr-dev libxcursor-dev + +ENV SCRIPTS_DIR=/tmp/scripts +COPY builder/scripts $SCRIPTS_DIR +RUN $SCRIPTS_DIR/build-webp +RUN $SCRIPTS_DIR/build-libjpeg-turbo + +RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo + +COPY --chown=docker:docker . /src/ + +USER docker +ENTRYPOINT ["/src/builder/build.sh"] diff --git a/builder/dockerfile.ubuntu_noble.deb.build b/builder/dockerfile.ubuntu_noble.deb.build new file mode 100644 index 0000000..6a56b24 --- /dev/null +++ b/builder/dockerfile.ubuntu_noble.deb.build @@ -0,0 +1,19 @@ +FROM ubuntu:noble + +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update && \ + apt-get -y install vim build-essential devscripts equivs + +# Install build-deps for the package. +COPY ./debian/control /tmp +RUN apt-get update && echo YYY | mk-build-deps --install --remove /tmp/control + +ARG L_UID +RUN if [ "$L_UID" -eq 0 ]; then \ + useradd -m docker; \ + else \ + useradd -m docker -u $L_UID;\ + fi + +USER docker diff --git a/builder/dockerfile.ubuntu_noble.deb.test b/builder/dockerfile.ubuntu_noble.deb.test new file mode 100644 index 0000000..37e92ca --- /dev/null +++ b/builder/dockerfile.ubuntu_noble.deb.test @@ -0,0 +1,57 @@ +FROM ubuntu:noble + +ENV DISPLAY=:1 \ + VNC_PORT=8443 \ + VNC_RESOLUTION=1280x720 \ + MAX_FRAME_RATE=24 \ + VNCOPTIONS="-PreferBandwidth -DynamicQualityMin=4 -DynamicQualityMax=7" \ + HOME=/home/user \ + TERM=xterm \ + STARTUPDIR=/dockerstartup \ + INST_SCRIPTS=/dockerstartup/install \ + KASM_RX_HOME=/dockerstartup/kasmrx \ + DEBIAN_FRONTEND=noninteractive \ + VNC_COL_DEPTH=24 \ + VNC_RESOLUTION=1280x1024 \ + VNC_PW=vncpassword \ + VNC_USER=user \ + VNC_VIEW_ONLY_PW=vncviewonlypassword \ + LD_LIBRARY_PATH=/usr/local/lib/ \ + OMP_WAIT_POLICY=PASSIVE \ + SHELL=/bin/bash \ + SINGLE_APPLICATION=0 \ + KASMVNC_BUILD_OS=ubuntu \ + KASMVNC_BUILD_OS_CODENAME=noble + +EXPOSE $VNC_PORT + +WORKDIR $HOME + +### REQUIRED STUFF ### + +RUN apt-get update && apt-get install -y supervisor xfce4 xfce4-terminal xterm libnss-wrapper gettext wget +RUN apt-get purge -y pm-utils xscreensaver* +RUN apt-get update && apt-get install -y vim less +RUN apt-get update && apt-get -y install lsb-release + +RUN echo 'source $STARTUPDIR/generate_container_user' >> $HOME/.bashrc + +RUN mkdir -p $STARTUPDIR +COPY builder/startup/ $STARTUPDIR + +### START CUSTOM STUFF #### + +ARG KASMVNC_PACKAGE_DIR +COPY $KASMVNC_PACKAGE_DIR/kasmvncserver_*.deb /tmp/ +RUN rm -f /tmp/kasmvncserver_*+*.deb; dpkg -i /tmp/*.deb; apt-get -yf install + +RUN mkdir ~/.vnc && echo '/usr/bin/xfce4-session &' >> ~/.vnc/xstartup && \ + chmod +x ~/.vnc/xstartup + +### END CUSTOM STUFF ### + +RUN chown -R 1000:0 $HOME +USER 1000:ssl-cert +WORKDIR $HOME + +ENTRYPOINT [ "/dockerstartup/vnc_startup.sh" ] diff --git a/builder/dockerfile.ubuntu_noble.test b/builder/dockerfile.ubuntu_noble.test new file mode 100644 index 0000000..c1e84e6 --- /dev/null +++ b/builder/dockerfile.ubuntu_noble.test @@ -0,0 +1,51 @@ +FROM ubuntu:noble + +ENV DISPLAY=:1 \ + VNC_PORT=8443 \ + VNC_RESOLUTION=1280x720 \ + MAX_FRAME_RATE=24 \ + VNCOPTIONS="-PreferBandwidth -DynamicQualityMin=4 -DynamicQualityMax=7" \ + HOME=/home/user \ + TERM=xterm \ + STARTUPDIR=/dockerstartup \ + INST_SCRIPTS=/dockerstartup/install \ + KASM_RX_HOME=/dockerstartup/kasmrx \ + DEBIAN_FRONTEND=noninteractive \ + VNC_COL_DEPTH=24 \ + VNC_RESOLUTION=1280x1024 \ + VNC_PW=vncpassword \ + VNC_USER=user \ + VNC_VIEW_ONLY_PW=vncviewonlypassword \ + LD_LIBRARY_PATH=/usr/local/lib/ \ + OMP_WAIT_POLICY=PASSIVE \ + SHELL=/bin/bash \ + SINGLE_APPLICATION=0 \ + KASMVNC_BUILD_OS=ubuntu \ + KASMVNC_BUILD_OS_CODENAME=noble + +EXPOSE $VNC_PORT + +WORKDIR $HOME + +### REQUIRED STUFF ### + +RUN apt-get update && apt-get install -y supervisor xfce4 xfce4-terminal xterm libnss-wrapper gettext wget +RUN apt-get purge -y pm-utils xscreensaver* + +RUN echo 'source $STARTUPDIR/generate_container_user' >> $HOME/.bashrc + +RUN mkdir -p $STARTUPDIR +COPY startup/ $STARTUPDIR + +### START CUSTOM STUFF #### + +COPY build/kasmvnc.${KASMVNC_BUILD_OS}_${KASMVNC_BUILD_OS_CODENAME}.tar.gz /tmp/ +RUN tar -xzvf /tmp/kasmvnc.${KASMVNC_BUILD_OS}_${KASMVNC_BUILD_OS_CODENAME}.tar.gz --strip 1 -C / + +### END CUSTOM STUFF ### + +RUN chown -R 1000:0 $HOME +USER 1000 +WORKDIR $HOME + +ENTRYPOINT [ "/dockerstartup/vnc_startup.sh" ]