Dockerfile 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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-dev \
  23. python-pip \
  24. python-setuptools \
  25. python3 \
  26. imagemagick \
  27. srecord \
  28. git \
  29. pkg-config \
  30. dfu-util \
  31. && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
  32. RUN pip install lxml
  33. SHELL ["/bin/bash", "-eo", "pipefail", "-c"]
  34. 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"
  35. # hadolint ignore=DL3008
  36. RUN apt-get update && \
  37. apt-get install -y --no-install-recommends \
  38. libclang-12-dev \
  39. clang-format-12 \
  40. && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
  41. # install arm-none-eabi
  42. # hadolint ignore=DL3003
  43. 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" && \
  44. tar xjf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 && \
  45. rm 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. # hadolint ignore=DL3003
  51. RUN wget --progress=dot:giga "https://github.com/rusdacent/hex2dfu/archive/master.zip" --output-document=hex2dfu.zip && \
  52. unzip hex2dfu.zip && \
  53. rm hex2dfu.zip && \
  54. cd hex2dfu-master && gcc hex2dfu.c ED25519/*.c -o hex2dfu && \
  55. ln -s "${PWD}/hex2dfu" /usr/bin/hex2dfu
  56. # install openocd
  57. # hadolint ignore=DL3003
  58. RUN git clone --depth 1 --branch v0.11.0 https://github.com/ntfreak/openocd.git && \
  59. cd openocd && ./bootstrap && ./configure && make install && \
  60. cd .. && rm -rf openocd && \
  61. openocd --version
  62. COPY entrypoint.sh syntax_check.sh /
  63. RUN chmod +x /syntax_check.sh
  64. ENTRYPOINT ["/entrypoint.sh"]