From 77dc72ce641b4c8327e62f687681c559bc305740 Mon Sep 17 00:00:00 2001 From: Marc Adler Date: Thu, 13 Mar 2025 01:23:10 +0100 Subject: [PATCH] modified: CubeClt/Dockerfile modified: CubeClt/build_and_publish.sh modified: CubeMx/Dockerfile new file: CubeMx/Resources/CubeMX/start-cubemx.sh modified: CubeMx/build_and_publish.sh new file: build_and_publish.sh --- CubeClt/Dockerfile | 1 + CubeClt/build_and_publish.sh | 5 +++-- CubeMx/Dockerfile | 23 +++++++++++++++-------- CubeMx/Resources/CubeMX/start-cubemx.sh | 1 + CubeMx/build_and_publish.sh | 9 ++++++++- build_and_publish.sh | 22 ++++++++++++++++++++++ 6 files changed, 50 insertions(+), 11 deletions(-) create mode 100755 CubeMx/Resources/CubeMX/start-cubemx.sh create mode 100755 build_and_publish.sh diff --git a/CubeClt/Dockerfile b/CubeClt/Dockerfile index 8bc0834..307c0dd 100644 --- a/CubeClt/Dockerfile +++ b/CubeClt/Dockerfile @@ -20,6 +20,7 @@ RUN if [ "${INSTALL_CUBE_CLT}" = "true" ]; then \ fi \ && rm -rf /tmp/CubeCLT +RUN apt-get clean # [Optional] Uncomment this section to install additional vcpkg ports. # RUN su vscode -c "${VCPKG_ROOT}/vcpkg install " diff --git a/CubeClt/build_and_publish.sh b/CubeClt/build_and_publish.sh index ed54430..53ed800 100755 --- a/CubeClt/build_and_publish.sh +++ b/CubeClt/build_and_publish.sh @@ -1,4 +1,5 @@ #!/bin/bash +script_dir=$(dirname "$(readlink -f "$0")") push=false # Process oprions @@ -13,8 +14,8 @@ done -docker build -t nexus.springblast.de:8082/carly/docker-stm32/cubeclt:$tag . -docker build -t nexus.springblast.de:8082/carly/docker-stm32/cubeclt:latest . +docker build -t nexus.springblast.de:8082/carly/docker-stm32/cubeclt:$tag $script_dir/. +docker build -t nexus.springblast.de:8082/carly/docker-stm32/cubeclt:latest $script_dir/. if [ "$push" = true ]; then docker push nexus.springblast.de:8082/carly/docker-stm32/cubeclt:$tag diff --git a/CubeMx/Dockerfile b/CubeMx/Dockerfile index 0d3eb86..cdd78ec 100644 --- a/CubeMx/Dockerfile +++ b/CubeMx/Dockerfile @@ -3,17 +3,24 @@ FROM nexus.springblast.de:8082/carly/docker-stm32/cubeclt:latest ARG INSTALL_CUBEMX="true" # Install Xpra, X server, and window manager -RUN apt-get update && apt-get install -y xpra xorg openbox xauth xterm - -RUN apt-get update && apt-get install -y \ - libxext6 \ - libxrender1 \ - libxtst6 \ - libxi6 +# RUN apt-get update && apt-get install -y xpra xterm # Optionally install the CubeMX COPY ./Resources/CubeMX/cubemx.tar.gz /home/vscode -RUN tar -xvf /home/vscode/cubemx.tar.gz +RUN tar -xvf /home/vscode/cubemx.tar.gz -C /home/vscode +RUN rm /home/vscode/cubemx.tar.gz + +COPY ./Resources/CubeMX/start-cubemx.sh /home/vscode/ +RUN chmod +x /home/vscode/start-cubemx.sh + +RUN apt-get update && apt-get install -y python3-setuptools + +RUN cd /home/vscode && git clone --branch v6.2.5 --single-branch https://github.com/Xpra-org/xpra + +RUN cd /home/vscode/xpra && ./setup.py install-repo && apt-get update && apt-get install -y xpra + +RUN apt-get clean + # RUN if [ "${INSTALL_CUBEMX}" = "true" ]; then \ # chmod +x /tmp/CubeMX/install-cubemx.sh && /tmp/CubeMX/install-cubemx.sh; \ diff --git a/CubeMx/Resources/CubeMX/start-cubemx.sh b/CubeMx/Resources/CubeMX/start-cubemx.sh new file mode 100755 index 0000000..db2c472 --- /dev/null +++ b/CubeMx/Resources/CubeMX/start-cubemx.sh @@ -0,0 +1 @@ +xpra start :100 --start=/home/vscode/STM32CubeMX/STM32CubeMX --no-daemon --bind-tcp=0.0.0.0:14500 --html=on \ No newline at end of file diff --git a/CubeMx/build_and_publish.sh b/CubeMx/build_and_publish.sh index 9cf34fd..6677ccd 100755 --- a/CubeMx/build_and_publish.sh +++ b/CubeMx/build_and_publish.sh @@ -1,4 +1,5 @@ #!/bin/bash +script_dir=$(dirname "$(readlink -f "$0")") push=false # Process oprions @@ -12,4 +13,10 @@ while getopts "pt:" opt; do done -docker build -t nexus.springblast.de:8082/carly/docker-stm32/cubemx:$tag . \ No newline at end of file +docker build -t nexus.springblast.de:8082/carly/docker-stm32/cubemx:$tag $script_dir/. +docker build -t nexus.springblast.de:8082/carly/docker-stm32/cubemx:latest $script_dir/. + +if [ "$push" = true ]; then + docker push nexus.springblast.de:8082/carly/docker-stm32/cubemx:$tag + docker push nexus.springblast.de:8082/carly/docker-stm32/cubemx:latest +fi \ No newline at end of file diff --git a/build_and_publish.sh b/build_and_publish.sh new file mode 100755 index 0000000..d391400 --- /dev/null +++ b/build_and_publish.sh @@ -0,0 +1,22 @@ +#!/bin/bash +script_dir=$(dirname "$(readlink -f "$0")") + +push=false +# Process oprions +while getopts "pt:" opt; do + case $opt in + p) push=true;; + t) tag=$OPTARG;; + \?) echo "Invalid option: -$OPTARG" >&2 ;; + :) echo "Option -$OPTARG requires an argument." >&2 ;; + esac +done + +if [ "$push" = true ]; then + $script_dir/CubeClt/build_and_publish.sh -t $tag -p + $script_dir/CubeMx/build_and_publish.sh -t $tag -p +else + $script_dir/CubeClt/build_and_publish.sh -t $tag + $script_dir/CubeMx/build_and_publish.sh -t $tag +fi +