new cube clt and mx version

new docker registry
This commit is contained in:
2025-05-26 23:05:40 +02:00
parent 77dc72ce64
commit afe409f9d2
9 changed files with 83 additions and 99 deletions

View File

@@ -4,19 +4,35 @@
"name": "Debian", "name": "Debian",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"dockerFile": "../CubeMx/Dockerfile", "dockerFile": "../CubeMx/Dockerfile",
"privileged": true, "mounts": [
"forwardPorts": [14500, 14500] // 1. Share the X11 socket for GUI display
"source=/tmp/.X11-unix,target=/tmp/.X11-unix,type=bind,consistency=cached",
// Features to add to the dev container. More info: https://containers.dev/features. // 2. Share the D-Bus system socket (resolves the system_bus_socket error)
// "features": {}, "source=/var/run/dbus/system_bus_socket,target=/var/run/dbus/system_bus_socket,type=bind,consistency=cached",
// Use 'forwardPorts' to make a list of ports inside the container available locally. // 3. Share .Xauthority for X11 authorization (resolves "Authorization required" error)
// "forwardPorts": [], // Ensure the target path matches the container user's home.
"source=/run/user/1000/xauth_MASbDk,target=/home/vscode/.Xauthority,type=bind,consistency=cached"
// Make sure to adjust /home/vscode if your container user's home directory is different.
],
// Configure tool-specific properties. "containerEnv": {
// "customizations": {}, // 4. Set the DISPLAY variable to use the host's X server
"DISPLAY": "${localEnv:DISPLAY}",
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. // 5. If using .Xauthority mount, point to its location in the container
// "remoteUser": "root" "XAUTHORITY": "/home/vscode/.Xauthority"
},
// Optional: Command to ensure the container user owns the .Xauthority file if mounted.
// Adjust 'vscode' if your container user is different.
// "postCreateCommand": "sudo chown vscode:vscode /home/vscode/.Xauthority || echo 'Xauthority not found or permission change failed, this might be okay.'",
// Generally, avoid privileged: true.
// If you encounter permission issues that aren't solved by the above,
// adding specific capabilities is safer.
"privileged": true
} }

View File

@@ -2,7 +2,9 @@ FROM mcr.microsoft.com/devcontainers/cpp:1-debian-12
ARG REINSTALL_CMAKE_VERSION_FROM_SOURCE="3.22.2" ARG REINSTALL_CMAKE_VERSION_FROM_SOURCE="3.22.2"
ARG INSTALL_CUBE_CLT="true" ARG LICENSE_ALREADY_ACCEPTED=1
RUN apt-get update && apt-get upgrade -y
# Optionally install the cmake for vcpkg # Optionally install the cmake for vcpkg
COPY ./Resources/Scripts/reinstall-cmake.sh /tmp/ COPY ./Resources/Scripts/reinstall-cmake.sh /tmp/
@@ -14,18 +16,25 @@ RUN if [ "${REINSTALL_CMAKE_VERSION_FROM_SOURCE}" != "none" ]; then \
# Optionally install the Cube CLT # Optionally install the Cube CLT
COPY ../Resources/CubeCLT /tmp/CubeCLT/ RUN apt-get install --no-install-recommends -y unzip
RUN if [ "${INSTALL_CUBE_CLT}" = "true" ]; then \ RUN mkdir /home/temp
chmod +x /tmp/CubeCLT/install.sh && /tmp/CubeCLT/install.sh; \ WORKDIR /home/temp
fi \
&& rm -rf /tmp/CubeCLT
RUN apt-get clean RUN wget http://192.168.1.225:8081/repository/file/Stm32/en.st-stm32cubeclt_1.18.0_24403_20250225_1636_amd64.deb_bundle.sh.zip
RUN unzip en.st-stm32cubeclt_1.18.0_24403_20250225_1636_amd64.deb_bundle.sh.zip
RUN chmod +x st-stm32cubeclt_1.18.0_24403_20250225_1636_amd64.deb_bundle.sh && ./st-stm32cubeclt_1.18.0_24403_20250225_1636_amd64.deb_bundle.sh
WORKDIR /
RUN rm -rf /home/temp
# [Optional] Uncomment this section to install additional vcpkg ports. WORKDIR /home/vscode
# RUN su vscode -c "${VCPKG_ROOT}/vcpkg install <your-port-name-here>" RUN apt-get install --no-install-recommends -y python3-pip python3-venv
RUN python3 -m venv venv && ./venv/bin/pip install --no-cache-dir pyserial protobuf grpcio grpcio-tools
RUN usermod -aG sudo,dialout,plugdev vscode
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/*
USER vscode
# [Optional] Uncomment this section to install additional packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

View File

@@ -1,24 +0,0 @@
#!/usr/bin/env bash
# Set the script to fail if any command fails.
set -e
echo "Installing CubeCLT..."
# Extract zip file
unzip -q /tmp/CubeCLT/en.st-stm32cubeclt_1.17* -d /tmp/cubeclt
cd /tmp/cubeclt && chmod +x *.sh
export LICENSE_ALREADY_ACCEPTED=1
/tmp/cubeclt/*.sh --target . --noexec
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y /tmp/cubeclt/st-stlink-udev-rules*.deb
apt-get install -y /tmp/cubeclt/st-stlink-server*.deb
apt-get install -y /tmp/cubeclt/st-stm32cubeclt*.deb
rm -rf /tmp/cubeclt

View File

@@ -14,10 +14,10 @@ done
docker build -t nexus.springblast.de:8082/carly/docker-stm32/cubeclt:$tag $script_dir/. docker build -t docker.springblast.de/stm32/cubeclt:$tag $script_dir/.
docker build -t nexus.springblast.de:8082/carly/docker-stm32/cubeclt:latest $script_dir/. docker build -t docker.springblast.de/stm32/cubeclt:latest $script_dir/.
if [ "$push" = true ]; then if [ "$push" = true ]; then
docker push nexus.springblast.de:8082/carly/docker-stm32/cubeclt:$tag docker push docker.springblast.de/stm32/cubeclt:$tag
docker push nexus.springblast.de:8082/carly/docker-stm32/cubeclt:latest docker push docker.springblast.de/stm32/cubeclt:latest
fi fi

View File

@@ -1,31 +1,25 @@
FROM nexus.springblast.de:8082/carly/docker-stm32/cubeclt:latest FROM docker.springblast.de/stm32/cubeclt:latest
ARG INSTALL_CUBEMX="true" ARG LICENSE_ALREADY_ACCEPTED=1
USER root
# Install Xpra, X server, and window manager # Install Xpra, X server, and window manager
# RUN apt-get update && apt-get install -y xpra xterm # RUN apt-get update && apt-get install -y xpra xterm
# Optionally install the CubeMX RUN apt-get update && apt-get install --no-install-recommends -y chromium
COPY ./Resources/CubeMX/cubemx.tar.gz /home/vscode
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 mkdir /home/temp
RUN chmod +x /home/vscode/start-cubemx.sh WORKDIR /home/temp
RUN wget -q https://nexus.springblast.de/repository/file-repo/Stm32/en.stm32cubemx-lin-v6-14-1.zip
RUN apt-get update && apt-get install -y python3-setuptools RUN unzip en.stm32cubemx-lin-v6-14-1.zip
RUN chmod +x SetupSTM32CubeMX-6.14.1
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 \ COPY ./Resources/auto-install.xml .
# chmod +x /tmp/CubeMX/install-cubemx.sh && /tmp/CubeMX/install-cubemx.sh; \ RUN ./SetupSTM32CubeMX-6.14.1 auto-install.xml
# fi
# && rm -rf /tmp/CubeMX
#CMD xpra start --start=xeyes --bind-tcp=0.0.0.0:14500 --html=on --daemon=no && bash RUN rm -rf /home/temp
#sudo xpra start :100 --start=xterm --no-daemon --bind-tcp=0.0.0.0:14500 --html=on
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/*

View File

@@ -1,22 +0,0 @@
#!/usr/bin/env bash
# Set the script to fail if any command fails.
set -e
# Cleanup temporary directory and associated files when exiting the script.
cleanup() {
EXIT_CODE=$?
set +e
if [[ -n "${TMP_DIR}" ]]; then
echo "Executing cleanup of tmp files"
rm -Rf "${TMP_DIR}"
fi
exit $EXIT_CODE
}
echo "Installing CubeMX..."
# Extract zip file
unzip -q /tmp/CubeMX/en.stm32cubemx-lin-v6-13-0.zip -d /tmp/CubeMX

View File

@@ -1 +0,0 @@
xpra start :100 --start=/home/vscode/STM32CubeMX/STM32CubeMX --no-daemon --bind-tcp=0.0.0.0:14500 --html=on

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<AutomatedInstallation langpack="eng">
<com.st.microxplorer.install.MXHTMLHelloPanel id="readme"/>
<com.st.microxplorer.install.MXLicensePanel id="licence.panel"/>
<com.st.microxplorer.install.MXAnalyticsPanel id="analytics.panel"/>
<com.st.microxplorer.install.MXTargetPanel id="target.panel">
<installpath>/usr/local/STMicroelectronics/STM32Cube/STM32CubeMX</installpath>
</com.st.microxplorer.install.MXTargetPanel>
<com.st.microxplorer.install.MXShortcutPanel id="shortcut.panel"/>
<com.st.microxplorer.install.MXInstallPanel id="install.panel"/>
<com.st.microxplorer.install.MXFinishPanel id="finish.panel"/>
</AutomatedInstallation>

View File

@@ -13,10 +13,10 @@ while getopts "pt:" opt; do
done done
docker build -t nexus.springblast.de:8082/carly/docker-stm32/cubemx:$tag $script_dir/. docker build -t docker.springblast.de/stm32/cubemx:$tag $script_dir/.
docker build -t nexus.springblast.de:8082/carly/docker-stm32/cubemx:latest $script_dir/. docker build -t docker.springblast.de/stm32/cubemx:latest $script_dir/.
if [ "$push" = true ]; then if [ "$push" = true ]; then
docker push nexus.springblast.de:8082/carly/docker-stm32/cubemx:$tag docker push docker.springblast.de/stm32/cubemx:$tag
docker push nexus.springblast.de:8082/carly/docker-stm32/cubemx:latest docker push docker.springblast.de/stm32/cubemx:latest
fi fi