Dockerfile 1.9 KB

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