Dockerfile 2.2 KB

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