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 +