Dockerfile 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. FROM ubuntu:20.04
  2. ARG DEBIAN_FRONTEND=noninteractive
  3. COPY components/wifi-manager/webapp/package.json /opt
  4. # We need libpython2.7 due to GDB tools
  5. RUN : \
  6. && apt-get update \
  7. && apt-get install -y \
  8. apt-utils \
  9. bison \
  10. ca-certificates \
  11. ccache \
  12. check \
  13. curl \
  14. flex \
  15. git \
  16. gperf \
  17. lcov \
  18. libffi-dev \
  19. libncurses-dev \
  20. libpython2.7 \
  21. libusb-1.0-0-dev \
  22. make \
  23. ninja-build \
  24. python3 \
  25. python3-pip \
  26. unzip \
  27. wget \
  28. xz-utils \
  29. zip \
  30. npm \
  31. nodejs \
  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. && cd /opt \
  39. && npm install -g \
  40. && :
  41. # To build the image for a branch or a tag of IDF, pass --build-arg IDF_CLONE_BRANCH_OR_TAG=name.
  42. # To build the image with a specific commit ID of IDF, pass --build-arg IDF_CHECKOUT_REF=commit-id.
  43. # It is possibe to combine both, e.g.:
  44. # IDF_CLONE_BRANCH_OR_TAG=release/vX.Y
  45. # IDF_CHECKOUT_REF=<some commit on release/vX.Y branch>.
  46. # The following commit contains the ldgen fix: eab738c79e063b3d6f4c345ea5e1d4f8caef725b
  47. # to build an image using that commit: docker build . --build-arg IDF_CHECKOUT_REF=eab738c79e063b3d6f4c345ea5e1d4f8caef725b -t sle118/squeezelite-esp32-idfv4-master
  48. # docker build . --build-arg IDF_CHECKOUT_REF=8bf14a9238329954c7c5062eeeda569529aedf75 -t sle118/squeezelite-esp32-idfv4-master
  49. # To run the image interactive (windows): docker run --rm -v %cd%:/project -w /project -it sle118/squeezelite-esp32-idfv4-master
  50. # to build the web app inside of the interactive session
  51. # pushd components/wifi-manager/webapp/ && npm rebuild node-sass && npm run-script build && popd
  52. ARG IDF_CLONE_URL=https://github.com/espressif/esp-idf.git
  53. ARG IDF_CLONE_BRANCH_OR_TAG=master
  54. ARG IDF_CHECKOUT_REF=eab738c79e063b3d6f4c345ea5e1d4f8caef725b
  55. ENV IDF_PATH=/opt/esp/idf
  56. ENV IDF_TOOLS_PATH=/opt/esp
  57. RUN echo IDF_CHECKOUT_REF=$IDF_CHECKOUT_REF IDF_CLONE_BRANCH_OR_TAG=$IDF_CLONE_BRANCH_OR_TAG && \
  58. git clone --recursive \
  59. ${IDF_CLONE_BRANCH_OR_TAG:+-b $IDF_CLONE_BRANCH_OR_TAG} \
  60. $IDF_CLONE_URL $IDF_PATH && \
  61. if [ -n "$IDF_CHECKOUT_REF" ]; then \
  62. cd $IDF_PATH && \
  63. git checkout $IDF_CHECKOUT_REF && \
  64. git submodule update --init --recursive; \
  65. fi
  66. COPY docker/patches $IDF_PATH
  67. # Install all the required tools
  68. RUN : \
  69. && update-ca-certificates --fresh \
  70. && $IDF_PATH/tools/idf_tools.py --non-interactive install required \
  71. && $IDF_PATH/tools/idf_tools.py --non-interactive install cmake \
  72. && $IDF_PATH/tools/idf_tools.py --non-interactive install-python-env \
  73. && rm -rf $IDF_TOOLS_PATH/dist \
  74. && :
  75. # Ccache is installed, enable it by default
  76. ENV IDF_CCACHE_ENABLE=1
  77. COPY docker/entrypoint.sh /opt/esp/entrypoint.sh
  78. ENTRYPOINT [ "/opt/esp/entrypoint.sh" ]
  79. CMD [ "/bin/bash" ]