From 62d751c24950447f0eaa7379acc6a4f9a40ff297 Mon Sep 17 00:00:00 2001 From: Mario1159 Date: Wed, 27 Sep 2023 18:26:03 -0300 Subject: [PATCH] Add option to set latest volare PDK by setting the PDK env var at runtime --- base/desktop.Dockerfile | 2 +- base/web.Dockerfile | 2 +- scripts/start_desktop | 3 +++ scripts/{startserver => start_server} | 2 ++ scripts/volare_set_latest | 5 +++++ 5 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 scripts/start_desktop rename scripts/{startserver => start_server} (95%) create mode 100644 scripts/volare_set_latest diff --git a/base/desktop.Dockerfile b/base/desktop.Dockerfile index 2256ba5..2fe4cb4 100644 --- a/base/desktop.Dockerfile +++ b/base/desktop.Dockerfile @@ -32,4 +32,4 @@ COPY --chown=designer:designer --chmod=755 scripts/* /home/designer/.scripts ENV PATH="/home/designer/.scripts:${PATH}" # Initialize the enviroment keeping container alive -CMD ["sleep", "infinity"] +ENTRYPOINT ["start_desktop"] diff --git a/base/web.Dockerfile b/base/web.Dockerfile index c812d5a..9558c4e 100644 --- a/base/web.Dockerfile +++ b/base/web.Dockerfile @@ -35,4 +35,4 @@ COPY --chown=designer:designer include/desktopinit.desktop /home/designer/.confi # Start VNC & desktop environment WORKDIR /home/designer -ENTRYPOINT ["startserver"] +ENTRYPOINT ["start_server"] diff --git a/scripts/start_desktop b/scripts/start_desktop new file mode 100644 index 0000000..66d7011 --- /dev/null +++ b/scripts/start_desktop @@ -0,0 +1,3 @@ +#!/bin/bash +volare_set_latest +sleep infinity \ No newline at end of file diff --git a/scripts/startserver b/scripts/start_server similarity index 95% rename from scripts/startserver rename to scripts/start_server index 4b4380a..60c3a51 100644 --- a/scripts/startserver +++ b/scripts/start_server @@ -18,5 +18,7 @@ echo "XServer has been found, running desktop environment" # Run desktop environment (XFCE) xfce4-session --display=$DISPLAY +volare_set_latest + # Keep container alive sleep infinity diff --git a/scripts/volare_set_latest b/scripts/volare_set_latest new file mode 100644 index 0000000..87dd734 --- /dev/null +++ b/scripts/volare_set_latest @@ -0,0 +1,5 @@ +#!/bin/bash +if [[ -z "${PDK}" ]]; then + PDK_VERSION=$(volare ls-remote --pdk $PDK | sed -n '1 p') + volare enable --pdk $PDK $PDK_VERSION +fi \ No newline at end of file