Dockerfile 2.0 KB

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