Dockerfile 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. FROM ubuntu:18.04
  2. # hadolint ignore=DL3008
  3. RUN apt-get update && \
  4. DEBIAN_FRONTEND=noninteractive apt-get 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. SHELL ["/bin/bash", "-eo", "pipefail", "-c"]
  31. RUN wget --progress=dot:giga -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"
  32. # hadolint ignore=DL3008
  33. RUN apt-get update && \
  34. apt-get install -y --no-install-recommends \
  35. libclang-12-dev \
  36. clang-format-12 \
  37. && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
  38. # install arm-none-eabi
  39. # hadolint ignore=DL3003
  40. RUN wget --progress=dot:giga "https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2" && \
  41. tar xjf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 && \
  42. rm gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 && \
  43. cd gcc-arm-none-eabi-10-2020-q4-major/bin/ && \
  44. for file in * ; do ln -s "${PWD}/${file}" "/usr/bin/${file}" ; done && \
  45. cd / && arm-none-eabi-gcc -v && arm-none-eabi-gdb -v
  46. # install hex2dfu
  47. # hadolint ignore=DL3003
  48. RUN wget --progress=dot:giga "https://github.com/rusdacent/hex2dfu/archive/master.zip" --output-document=hex2dfu.zip && \
  49. unzip hex2dfu.zip && \
  50. rm hex2dfu.zip && \
  51. cd hex2dfu-master && gcc hex2dfu.c ED25519/*.c -o hex2dfu && \
  52. ln -s "${PWD}/hex2dfu" /usr/bin/hex2dfu
  53. # install openocd
  54. # hadolint ignore=DL3003
  55. RUN git clone --depth 1 --branch v0.11.0 https://github.com/ntfreak/openocd.git && \
  56. cd openocd && ./bootstrap && ./configure && make install && \
  57. cd .. && rm -rf openocd && \
  58. openocd --version
  59. COPY entrypoint.sh syntax_check.sh /
  60. RUN chmod +x /syntax_check.sh
  61. ENTRYPOINT ["/entrypoint.sh"]