Dockerfile 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. FROM ubuntu:18.04
  2. ENV PATH /root/.cargo/bin:$PATH
  3. RUN apt update && \
  4. DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
  5. software-properties-common \
  6. gpg-agent \
  7. make \
  8. cmake \
  9. autoconf \
  10. automake \
  11. libtool \
  12. libusb-1.0 \
  13. libusb-1.0-0-dev \
  14. libgtk-3-dev pandoc \
  15. curl \
  16. wget \
  17. g++ \
  18. gcc \
  19. unzip \
  20. build-essential \
  21. python \
  22. python-pip \
  23. python3 \
  24. imagemagick \
  25. srecord \
  26. git \
  27. pkg-config \
  28. dfu-util \
  29. && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
  30. RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key| apt-key add - && add-apt-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-12 main"
  31. RUN apt update && \
  32. apt install -y --no-install-recommends \
  33. libclang-12-dev \
  34. clang-format-12 \
  35. && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
  36. RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --profile=minimal --target thumbv7em-none-eabi thumbv7em-none-eabihf && \
  37. rustup component add rustfmt --toolchain stable-x86_64-unknown-linux-gnu
  38. # st-flash
  39. RUN wget https://github.com/stlink-org/stlink/archive/v1.5.1.zip && \
  40. unzip v1.5.1.zip && \
  41. cd stlink-1.5.1 && make clean && make release && \
  42. cd build/Release && make install && ldconfig
  43. # install arm-none-eabi
  44. RUN wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 && \
  45. tar xjf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 && \
  46. cd gcc-arm-none-eabi-10-2020-q4-major/bin/ && \
  47. for file in * ; do ln -s ${PWD}/${file} /usr/bin/${file} ; done && \
  48. cd / && arm-none-eabi-gcc -v && arm-none-eabi-gdb -v
  49. # install hex2dfu
  50. RUN wget https://github.com/rusdacent/hex2dfu/archive/master.zip --output-document=hex2dfu.zip && \
  51. unzip hex2dfu.zip && \
  52. cd hex2dfu-master && gcc hex2dfu.c ED25519/*.c -o hex2dfu && \
  53. ln -s ${PWD}/hex2dfu /usr/bin/hex2dfu
  54. # install openocd
  55. RUN git clone --depth 1 --branch v0.11.0 https://github.com/ntfreak/openocd.git && \
  56. cd openocd && ./bootstrap && ./configure && ls -la && make install && \
  57. openocd --version
  58. COPY entrypoint.sh syntax_check.sh /
  59. RUN chmod +x /syntax_check.sh
  60. ENTRYPOINT ["/entrypoint.sh"]