Dockerfile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. FROM ubuntu:20.04
  2. ARG DEBIAN_FRONTEND=noninteractive
  3. # We need libpython2.7 due to GDB tools
  4. RUN : \
  5. && apt-get update \
  6. && apt-get install -y \
  7. apt-utils \
  8. bison \
  9. ca-certificates \
  10. ccache \
  11. check \
  12. curl \
  13. flex \
  14. git \
  15. gperf \
  16. lcov \
  17. libffi-dev \
  18. libncurses-dev \
  19. libpython2.7 \
  20. libusb-1.0-0-dev \
  21. make \
  22. ninja-build \
  23. python3 \
  24. python3-pip \
  25. unzip \
  26. wget \
  27. xz-utils \
  28. zip \
  29. && apt-get autoremove -y \
  30. && rm -rf /var/lib/apt/lists/* \
  31. && update-alternatives --install /usr/bin/python python /usr/bin/python3 10 \
  32. && python -m pip install --upgrade \
  33. pip \
  34. virtualenv \
  35. && :
  36. # To build the image for a branch or a tag of IDF, pass --build-arg IDF_CLONE_BRANCH_OR_TAG=name.
  37. # To build the image with a specific commit ID of IDF, pass --build-arg IDF_CHECKOUT_REF=commit-id.
  38. # It is possibe to combine both, e.g.:
  39. # IDF_CLONE_BRANCH_OR_TAG=release/vX.Y
  40. # IDF_CHECKOUT_REF=<some commit on release/vX.Y branch>.
  41. ARG IDF_CLONE_URL=https://github.com/espressif/esp-idf.git
  42. ARG IDF_CLONE_BRANCH_OR_TAG=master
  43. ARG IDF_CHECKOUT_REF=
  44. ENV IDF_PATH=/opt/esp/idf
  45. ENV IDF_TOOLS_PATH=/opt/esp
  46. RUN echo IDF_CHECKOUT_REF=$IDF_CHECKOUT_REF IDF_CLONE_BRANCH_OR_TAG=$IDF_CLONE_BRANCH_OR_TAG && \
  47. git clone --recursive \
  48. ${IDF_CLONE_BRANCH_OR_TAG:+-b $IDF_CLONE_BRANCH_OR_TAG} \
  49. $IDF_CLONE_URL $IDF_PATH && \
  50. if [ -n "$IDF_CHECKOUT_REF" ]; then \
  51. cd $IDF_PATH && \
  52. git checkout $IDF_CHECKOUT_REF && \
  53. git submodule update --init --recursive; \
  54. fi
  55. # Install all the required tools
  56. RUN : \
  57. && update-ca-certificates --fresh \
  58. && $IDF_PATH/tools/idf_tools.py --non-interactive install required \
  59. && $IDF_PATH/tools/idf_tools.py --non-interactive install cmake \
  60. && $IDF_PATH/tools/idf_tools.py --non-interactive install-python-env \
  61. && rm -rf $IDF_TOOLS_PATH/dist \
  62. && :
  63. # Ccache is installed, enable it by default
  64. ENV IDF_CCACHE_ENABLE=1
  65. COPY entrypoint.sh /opt/esp/entrypoint.sh
  66. ENTRYPOINT [ "/opt/esp/entrypoint.sh" ]
  67. CMD [ "/bin/bash" ]