Dockerfile 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. FROM espressif/idf:v4.4.6
  2. # Install additional dependencies
  3. RUN apt-get update && apt-get install -y \
  4. python3-protobuf
  5. RUN DEBIAN_FRONTEND=noninteractive TZ=America/Toronto apt-get -y install tzdata
  6. # Add any other dependencies you need
  7. # To build the image for a branch or a tag of IDF, pass --build-arg IDF_CLONE_BRANCH_OR_TAG=name.
  8. # To build the image with a specific commit ID of IDF, pass --build-arg IDF_CHECKOUT_REF=commit-id.
  9. # It is possibe to combine both, e.g.:
  10. # IDF_CLONE_BRANCH_OR_TAG=release/vX.Y
  11. # IDF_CHECKOUT_REF=<some commit on release/vX.Y branch>.
  12. # Docker build for release 4.3.5 as of 2023/05/18
  13. # docker build . --build-arg IDF_CHECKOUT_REF=6d04316cbe4dc35ea7e4885e9821bd9958ac996d -t sle118/squeezelite-esp32-idfv446
  14. # Updating the docker image in the repository
  15. # docker push sle118/squeezelite-esp32-idfv446
  16. # or to do both:
  17. # docker build . --build-arg IDF_CHECKOUT_REF=6d04316cbe4dc35ea7e4885e9821bd9958ac996d -t sle118/squeezelite-esp32-idfv446 && docker push sle118/squeezelite-esp32-idfv446
  18. # docker build . -t sle118/squeezelite-esp32-idfv446 && docker push sle118/squeezelite-esp32-idfv446
  19. #docker run --isolation=process --device="class/86E0D1E0-8089-11D0-9CE4-08003E301F73" mcr.microsoft.com/windows/servercore:1809
  20. # (windows) To run the image interactive :
  21. # docker run --rm -v %cd%:/project -w /project -it sle118/squeezelite-esp32-idfv446
  22. # (windows powershell)
  23. # docker run --rm -v ${PWD}:/project -w /project -it sle118/squeezelite-esp32-idfv446
  24. # (linux) To run the image interactive :
  25. # docker run --rm -v `pwd`:/project -w /project -it sle118/squeezelite-esp32-idfv446
  26. # to build the web app inside of the interactive session
  27. # pushd components/wifi-manager/webapp/ && npm install && npm run-script build && popd
  28. #
  29. # to run the docker with netwotrk port published on the host:
  30. # docker run --rm -p 5000:5000/tcp -v %cd%:/project -w /project -it sle118/squeezelite-esp32-idfv446
  31. RUN : \
  32. echo Installing pygit2 ******************************************************** \
  33. && . /opt/esp/python_env/idf4.4_py3.8_env/bin/activate \
  34. && ln -sf /opt/esp/python_env/idf4.4_py3.8_env/bin/python /usr/local/bin/python \
  35. && pip install pygit2 requests \
  36. && pip show pygit2 \
  37. && python --version \
  38. && pip --version \
  39. && pip install protobuf grpcio-tools \
  40. && rm -rf $IDF_TOOLS_PATH/dist \
  41. && apt-get install -y nodejs \
  42. && :
  43. # COPY docker/patches $IDF_PATH
  44. #set idf environment variabies
  45. ENV PATH /opt/esp/idf/components/esptool_py/esptool:/opt/esp/idf/components/espcoredump:/opt/esp/idf/components/partition_table:/opt/esp/idf/components/app_update:/opt/esp/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin:/opt/esp/tools/xtensa-esp32s2-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s2-elf/bin:/opt/esp/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin:/opt/esp/tools/riscv32-esp-elf/esp-2021r2-patch3-8.4.0/riscv32-esp-elf/bin:/opt/esp/tools/esp32ulp-elf/2.28.51-esp-20191205/esp32ulp-elf-binutils/bin:/opt/esp/tools/esp32s2ulp-elf/2.28.51-esp-20191205/esp32s2ulp-elf-binutils/bin:/opt/esp/tools/cmake/3.16.4/bin:/opt/esp/tools/openocd-esp32/v0.11.0-esp32-20220706/openocd-esp32/bin:/opt/esp/python_env/idf4.4_py3.8_env/bin:/opt/esp/idf/tools:$PATH
  46. ENV GCC_TOOLS_BASE="/opt/esp/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-"
  47. ENV IDF_PYTHON_ENV_PATH="/opt/esp/python_env/idf4.4_py3.8_env"
  48. ENV OPENOCD_SCRIPTS="/opt/esp/tools/openocd-esp32/v0.10.0-esp32-20211111/openocd-esp32/share/openocd/scripts"
  49. COPY docker/entrypoint.sh /opt/esp/entrypoint.sh
  50. COPY components/wifi-manager/webapp/package.json /opt
  51. ENV NODE_PATH="/v8/lib/node_modules"
  52. ENV NODE_VERSION="8"
  53. ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
  54. ENV PATH $IDF_PYTHON_ENV_PATH:$NVM_DIR/v$NODE_VERSION/bin:$PATH
  55. SHELL ["/bin/bash", "--login", "-c"]
  56. # Install NVM, Node.js, and global NPM packages
  57. RUN wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash \
  58. && export NVM_DIR="$HOME/.nvm" \
  59. && . "$NVM_DIR/nvm.sh" \
  60. && nvm install 16 \
  61. && nvm alias default 16 \
  62. && nvm use default \
  63. && echo "Node.js version:" && node --version \
  64. && echo "NPM version:" && npm --version \
  65. && echo "Installing global NPM packages..." \
  66. && cd /opt \
  67. && cat ./package.json | jq '.devDependencies | keys[] as $k | "\($k)@\(.[$k])"' | xargs -t npm install --global \
  68. && npm install -g html-webpack-plugin \
  69. && :
  70. COPY ./docker/build_tools.py /usr/sbin/build_tools.py
  71. RUN : \
  72. && echo Changing permissions ******************************************************** \
  73. && chmod +x /opt/esp/entrypoint.sh \
  74. && chmod +x /usr/sbin/build_tools.py \
  75. && :
  76. ENTRYPOINT [ "/opt/esp/entrypoint.sh" ]
  77. CMD [ "/bin/bash" ]