|
| 1 | +FROM ubuntu:latest AS downloader |
| 2 | +RUN apt-get update \ |
| 3 | + && apt-get -y install --no-install-recommends apt-utils \ |
| 4 | + && apt-get install -y \ |
| 5 | + curl \ |
| 6 | + xz-utils \ |
| 7 | + unzip \ |
| 8 | + wget |
| 9 | + |
| 10 | +RUN mkdir -p /tmp/dc-downloads /tmp/dc-extracted |
| 11 | + |
| 12 | +ARG GCC_VERSION=13.2.rel1 |
| 13 | +ARG GCC_URI=https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/$GCC_VERSION/binrel/arm-gnu-toolchain-$GCC_VERSION-x86_64-arm-none-eabi.tar.xz |
| 14 | +RUN mkdir -p /tmp/dc-downloads /tmp/dc-extracted/gcc \ |
| 15 | + && curl -o /tmp/dc-downloads/gcc-arm.tar.xz $GCC_URI \ |
| 16 | + && xz -d /tmp/dc-downloads/gcc-arm.tar.xz \ |
| 17 | + && tar -xvf /tmp/dc-downloads/gcc-arm.tar -C /tmp/dc-extracted/gcc --strip-components 1 \ |
| 18 | + && rm -rf /tmp/dc-extracted/gcc/share/doc/ /tmp/dc-extracted/gcc/share/gcc-arm-none-eabi/samples/ |
| 19 | + |
| 20 | +ARG CMAKE_VERSION=3.27.6 |
| 21 | +ARG CMAKE_SCRIPT=https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-linux-x86_64.sh |
| 22 | +RUN wget $CMAKE_SCRIPT \ |
| 23 | + -q -O /tmp/dc-downloads/cmake-install.sh \ |
| 24 | + && chmod u+x /tmp/dc-downloads/cmake-install.sh \ |
| 25 | + && mkdir -p /tmp/dc-extracted/cmake \ |
| 26 | + && /tmp/dc-downloads/cmake-install.sh --skip-license --prefix=/tmp/dc-extracted/cmake \ |
| 27 | + && rm /tmp/dc-downloads/cmake-install.sh |
| 28 | + |
| 29 | +FROM python:3.10 AS devcontainer |
| 30 | + |
| 31 | +# Avoid warnings by switching to noninteractive |
| 32 | +ENV DEBIAN_FRONTEND=noninteractive |
| 33 | + |
| 34 | +# You can set up non-root user |
| 35 | +# ARG USERNAME=vscode |
| 36 | +# ARG USER_UID=1000 |
| 37 | +# ARG USER_GID=$USER_UID |
| 38 | + |
| 39 | +# Configure apt and install packages |
| 40 | +RUN apt-get update \ |
| 41 | + && apt-get -y install --no-install-recommends apt-utils dialog icu-devtools 2>&1 \ |
| 42 | + && apt-get install -y \ |
| 43 | + git \ |
| 44 | + git-lfs \ |
| 45 | + git-svn \ |
| 46 | + subversion \ |
| 47 | + clang-format \ |
| 48 | + curl \ |
| 49 | + ninja-build \ |
| 50 | + srecord \ |
| 51 | + nodejs \ |
| 52 | + libffi-dev |
| 53 | + |
| 54 | +# Create needed directories |
| 55 | +RUN mkdir -p /usr/local/bin/gcc |
| 56 | + |
| 57 | +# Clone libs mbedtls and fatfs etc. |
| 58 | +RUN git clone --branch mbedtls-2.28.5 https://github.com/ARMmbed/mbedtls.git --depth 1 ./sources/mbedtls \ |
| 59 | + && git clone --branch R0.15 https://github.com/abbrev/fatfs.git --depth 1 ./sources/fatfs \ |
| 60 | + && git clone --branch STABLE-2_1_3_RELEASE https://github.com/lwip-tcpip/lwip.git --depth 1 ./sources/lwip |
| 61 | + |
| 62 | +# Clone FreeRTOS |
| 63 | +RUN git clone --branch V10.4.1-kernel-only https://github.com/FreeRTOS/FreeRTOS-Kernel.git --depth 1 ./sources/FreeRTOS \ |
| 64 | + && git clone --branch 5.5.1 https://github.com/ARM-software/CMSIS_5.git --depth 1 ./sources/CMSIS_5 |
| 65 | + |
| 66 | +# set gcc location |
| 67 | +ARG TMP_GCC_PATH=/usr/local/bin/gcc |
| 68 | +ENV ARM_GCC_PATH=$TMP_GCC_PATH/bin |
| 69 | + |
| 70 | +# Copy from our other container |
| 71 | +COPY --from=downloader /tmp/dc-extracted/gcc $TMP_GCC_PATH |
| 72 | +COPY --from=downloader /tmp/dc-extracted/cmake /usr/bin/cmake |
| 73 | + |
| 74 | +ENV PATH=/usr/bin/cmake/bin:${PATH} |
| 75 | + |
| 76 | +# Creating static link python for pyhton3 |
| 77 | +RUN ln -fs /usr/bin/python3 /usr/bin/python \ |
| 78 | + && pip3 install pyserial |
| 79 | + |
| 80 | +# Clean up downloaded files |
| 81 | +RUN apt-get autoremove -y \ |
| 82 | + && apt-get clean -y \ |
| 83 | + && rm -rf /var/lib/apt/lists/* |
| 84 | + |
| 85 | +# Switch back to dialog for any ad-hoc use of apt-get |
| 86 | +ENV DEBIAN_FRONTEND=dialog |
0 commit comments