Dockerfile 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. autoconf \
  9. automake \
  10. libtool \
  11. curl \
  12. wget \
  13. g++ \
  14. unzip \
  15. build-essential \
  16. python \
  17. python-pip \
  18. python3 \
  19. imagemagick \
  20. srecord \
  21. git \
  22. && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
  23. 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"
  24. RUN apt update && \
  25. apt install -y --no-install-recommends \
  26. libclang-12-dev \
  27. clang-format-12 \
  28. && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
  29. RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --profile=minimal --target thumbv7em-none-eabi thumbv7em-none-eabihf && \
  30. rustup component add rustfmt --toolchain stable-x86_64-unknown-linux-gnu
  31. # st-flash
  32. RUN apt update && \
  33. apt install -y --no-install-recommends \
  34. gcc build-essential cmake libusb-1.0 libusb-1.0-0-dev libgtk-3-dev pandoc \
  35. && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
  36. wget https://github.com/stlink-org/stlink/archive/v1.5.1.zip && \
  37. unzip v1.5.1.zip && \
  38. cd stlink-1.5.1 && make clean && make release && \
  39. cd build/Release && make install && ldconfig
  40. # dfu-util
  41. RUN apt update && \
  42. apt install -y --no-install-recommends \
  43. dfu-util \
  44. && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
  45. # install arm-none-eabi
  46. 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 && \
  47. tar xjf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 && \
  48. cd gcc-arm-none-eabi-10-2020-q4-major/bin/ && \
  49. for file in * ; do ln -s ${PWD}/${file} /usr/bin/${file} ; done
  50. RUN cd / && arm-none-eabi-gcc -v && arm-none-eabi-gdb -v
  51. # install hex2dfu
  52. RUN wget https://github.com/rusdacent/hex2dfu/archive/master.zip --output-document=hex2dfu.zip && \
  53. unzip hex2dfu.zip && \
  54. cd hex2dfu-master && gcc hex2dfu.c ED25519/*.c -o hex2dfu && \
  55. ln -s ${PWD}/hex2dfu /usr/bin/hex2dfu
  56. COPY entrypoint.sh syntax_check.sh /
  57. RUN chmod +x /syntax_check.sh
  58. ENTRYPOINT ["/entrypoint.sh"]