1010# -select usb=SERIAL1 -device STM32F103RE -endian little -speed 4000 -if swd
1111# Replace SERIAL1 with your J-Link serial number.
1212#
13- FROM ubuntu:22.04
13+ FROM ubuntu:latest
1414
1515# # Install required packages and JLink dependencies
1616RUN apt-get update && \
@@ -21,7 +21,8 @@ RUN apt-get update && \
2121# Copy both JLink packages into the container (they must be present in build context)
2222# COPY .github/workflows/JLink_Linux_${JLINK_VERSION}_x86_64.deb /tmp/JLink_Linux_${JLINK_VERSION}_x86_64.deb
2323# COPY .github/workflows/JLink_Linux_${JLINK_VERSION}_arm64.deb /tmp/JLink_Linux_${JLINK_VERSION}_arm64.deb
24-
24+ COPY JLink_x86_64.deb /tmp/JLink_x86_64.deb
25+ COPY JLink_arm.deb /tmp/JLink_arm.deb
2526# Workaround: replace udevadm with a stub to avoid postinst errors in Docker
2627RUN if [ -f /bin/udevadm ]; then mv /bin/udevadm /bin/udevadm.real; fi && \
2728 echo '#!/bin/bash' > /bin/udevadm && \
@@ -32,20 +33,12 @@ RUN if [ -f /bin/udevadm ]; then mv /bin/udevadm /bin/udevadm.real; fi && \
3233WORKDIR /tmp
3334RUN ARCH=$(uname -m) && \
3435 if [ "$ARCH" = "x86_64" ]; then \
35- wget --post-data "accept_license_agreement=accepted" \
36- https://www.segger.com/downloads/jlink/JLink_Linux_V794e_x86_64.deb \
37- -O JLink.deb && \
38- dpkg --force-depends -i JLink.deb && \
39- rm JLink.deb; \
36+ dpkg --force-depends -i JLink_x86_64.deb || true && \
37+ rm JLink_x86_64.deb; \
4038 elif [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then \
41- wget --post-data "accept_license_agreement=accepted" \
42- https://www.segger.com/downloads/jlink/JLink_Linux_V794e_arm64.deb \
43- -O JLink.deb && \
44- dpkg --force-depends -i JLink.deb && \
45- rm JLink.deb; \
39+ dpkg --force-depends -i JLink_arm.deb || true && \
40+ rm JLink_arm.deb; \
4641 fi
47-
48- # Restore real udevadm after J-Link installation
4942RUN if [ -f /bin/udevadm.real ]; then rm /bin/udevadm && mv /bin/udevadm.real /bin/udevadm; fi
5043
5144# Add user (optional)
0 commit comments