Dockerfile 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. FROM ubuntu:20.04
  2. ARG DEBIAN_FRONTEND=noninteractive
  3. ENV GCC_TOOLS_BASE=/opt/esp/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-
  4. # We need libpython2.7 due to GDB tools
  5. # we also need npm 8 for the webapp to work
  6. RUN : \
  7. && apt-get update \
  8. && apt-get install -y \
  9. apt-utils \
  10. bison \
  11. ca-certificates \
  12. ccache \
  13. check \
  14. curl \
  15. flex \
  16. git \
  17. gperf \
  18. lcov \
  19. libffi-dev \
  20. libncurses-dev \
  21. libpython2.7 \
  22. libusb-1.0-0-dev \
  23. make \
  24. ninja-build \
  25. python3 \
  26. python3-pip \
  27. unzip \
  28. wget \
  29. xz-utils \
  30. zip \
  31. npm \
  32. nodejs \
  33. && apt-get autoremove -y \
  34. && rm -rf /var/lib/apt/lists/* \
  35. && update-alternatives --install /usr/bin/python python /usr/bin/python3 10 \
  36. && python -m pip install --upgrade \
  37. pip \
  38. virtualenv \
  39. && cd /opt \
  40. && git clone https://github.com/HBehrens/puncover.git \
  41. && cd puncover \
  42. && python setup.py -q install \
  43. && :
  44. # To build the image for a branch or a tag of IDF, pass --build-arg IDF_CLONE_BRANCH_OR_TAG=name.
  45. # To build the image with a specific commit ID of IDF, pass --build-arg IDF_CHECKOUT_REF=commit-id.
  46. # It is possibe to combine both, e.g.:
  47. # IDF_CLONE_BRANCH_OR_TAG=release/vX.Y
  48. # IDF_CHECKOUT_REF=<some commit on release/vX.Y branch>.
  49. # The following commit contains the ldgen fix: eab738c79e063b3d6f4c345ea5e1d4f8caef725b
  50. # to build an image using that commit: docker build . --build-arg IDF_CHECKOUT_REF=eab738c79e063b3d6f4c345ea5e1d4f8caef725b -t sle118/squeezelite-esp32-idfv4-master
  51. # Docker build for release 4.3.2 as of 2022/02/28
  52. # docker build . --build-arg IDF_CHECKOUT_REF=8bf14a9238329954c7c5062eeeda569529aedf75 -t sle118/squeezelite-esp32-idfv4-master
  53. # To run the image interactive (windows): docker run --rm -v %cd%:/project -w /project -it sle118/squeezelite-esp32-idfv4-master
  54. # to build the web app inside of the interactive session
  55. # pushd components/wifi-manager/webapp/ && npm install && npm run-script build && popd
  56. #
  57. # to run the docker with netwotrk port published on the host:
  58. # docker run --rm -p 5000:5000/tcp -v %cd%:/project -w /project -it sle118/squeezelite-esp32-idfv4-master
  59. ARG IDF_CLONE_URL=https://github.com/espressif/esp-idf.git
  60. ARG IDF_CLONE_BRANCH_OR_TAG=master
  61. ARG IDF_CHECKOUT_REF=8bf14a9238329954c7c5062eeeda569529aedf75
  62. ENV IDF_PATH=/opt/esp/idf
  63. ENV IDF_TOOLS_PATH=/opt/esp
  64. RUN echo IDF_CHECKOUT_REF=$IDF_CHECKOUT_REF IDF_CLONE_BRANCH_OR_TAG=$IDF_CLONE_BRANCH_OR_TAG && \
  65. git clone --recursive \
  66. ${IDF_CLONE_BRANCH_OR_TAG:+-b $IDF_CLONE_BRANCH_OR_TAG} \
  67. $IDF_CLONE_URL $IDF_PATH && \
  68. if [ -n "$IDF_CHECKOUT_REF" ]; then \
  69. cd $IDF_PATH && \
  70. git checkout $IDF_CHECKOUT_REF && \
  71. git submodule update --init --recursive; \
  72. fi
  73. COPY docker/patches $IDF_PATH
  74. # Install all the required tools
  75. RUN : \
  76. && update-ca-certificates --fresh \
  77. && $IDF_PATH/tools/idf_tools.py --non-interactive install required \
  78. && $IDF_PATH/tools/idf_tools.py --non-interactive install cmake \
  79. && $IDF_PATH/tools/idf_tools.py --non-interactive install-python-env \
  80. && rm -rf $IDF_TOOLS_PATH/dist \
  81. && :
  82. # Ccache is installed, enable it by default
  83. ENV IDF_CCACHE_ENABLE=1
  84. COPY docker/entrypoint.sh /opt/esp/entrypoint.sh
  85. # Now install nodejs, npm and the packages we need
  86. COPY components/wifi-manager/webapp/package.json /opt
  87. ENV NODE_VERSION 8
  88. SHELL ["/bin/bash", "--login", "-c"]
  89. # Install nvm with node and npm
  90. # RUN wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash \
  91. # && export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" \
  92. # && [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" \
  93. # && nvm install $NODE_VERSION \
  94. # && nvm alias default $NODE_VERSION \
  95. # && nvm use default \
  96. # && echo installing nodejs version 16 \
  97. # && curl -sL https://deb.nodesource.com/setup_16.x | bash - \
  98. # && echo installing node modules \
  99. # && cd /opt \
  100. # && nvm use default \
  101. # && npm install -g \
  102. # && :
  103. RUN : \
  104. && curl -fsSL https://deb.nodesource.com/setup_16.x | bash - \
  105. && apt-get install -y nodejs \
  106. && echo installing node modules \
  107. && cd /opt \
  108. && npm i -g npm \
  109. && node --version \
  110. && npm install -g \
  111. && :
  112. ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
  113. ENV PATH $NVM_DIR/v$NODE_VERSION/bin:$PATH
  114. ENTRYPOINT [ "/opt/esp/entrypoint.sh" ]
  115. CMD [ "/bin/bash" ]