export.sh - tools not found on alpine
Posted: Sat Nov 04, 2023 10:06 pm
Hello all,
I am trying to get esp-idf running in an alpine docker image, but I get some weird errors when trying to run ". export.sh":
If I try to run the recommended idf_tools.py install command, it also says that everything is already installed.
What I notice, is that export.sh mentions /usr/bin/python3 as the python interpreter.
But install.sh has already created a python venv by now.
So the python interpreter seems to be wrong, could that be a problem?
This is the output of install.sh, when run in the alpine image:
Does anyone know what the problem could be? Thank you!
I am trying to get esp-idf running in an alpine docker image, but I get some weird errors when trying to run ". export.sh":
For some reason it thinks that the tools are not installed, but I checked some of the folders and they are not empty.Detecting the Python interpreter
Checking "python3" ...
Python 3.11.6
"python3" has been detected
Checking Python compatibility
Checking other ESP-IDF version.
WARNING: directory for tool xtensa-esp-elf-gdb version 12.1_20221002 is present, but tool was not found
ERROR: tool xtensa-esp-elf-gdb has no installed versions. Please run '/usr/bin/python3 /home/idftester/esp-idf/tools/idf_tools.py install' to install it.
WARNING: directory for tool riscv32-esp-elf-gdb version 12.1_20221002 is present, but tool was not found
ERROR: tool riscv32-esp-elf-gdb has no installed versions. Please run '/usr/bin/python3 /home/idftester/esp-idf/tools/idf_tools.py install' to install it.
WARNING: directory for tool xtensa-esp32-elf version esp-12.2.0_20230208 is present, but tool was not found
ERROR: tool xtensa-esp32-elf has no installed versions. Please run '/usr/bin/python3 /home/idftester/esp-idf/tools/idf_tools.py install' to install it.
WARNING: directory for tool xtensa-esp32s2-elf version esp-12.2.0_20230208 is present, but tool was not found
ERROR: tool xtensa-esp32s2-elf has no installed versions. Please run '/usr/bin/python3 /home/idftester/esp-idf/tools/idf_tools.py install' to install it.
WARNING: directory for tool xtensa-esp32s3-elf version esp-12.2.0_20230208 is present, but tool was not found
ERROR: tool xtensa-esp32s3-elf has no installed versions. Please run '/usr/bin/python3 /home/idftester/esp-idf/tools/idf_tools.py install' to install it.
WARNING: directory for tool riscv32-esp-elf version esp-12.2.0_20230208 is present, but tool was not found
ERROR: tool riscv32-esp-elf has no installed versions. Please run '/usr/bin/python3 /home/idftester/esp-idf/tools/idf_tools.py install' to install it.
WARNING: directory for tool esp32ulp-elf version 2.35_20220830 is present, but tool was not found
ERROR: tool esp32ulp-elf has no installed versions. Please run '/usr/bin/python3 /home/idftester/esp-idf/tools/idf_tools.py install' to install it.
WARNING: directory for tool openocd-esp32 version v0.12.0-esp32-20230921 is present, but tool was not found
ERROR: tool openocd-esp32 has no installed versions. Please run '/usr/bin/python3 /home/idftester/esp-idf/tools/idf_tools.py install' to install it.
If I try to run the recommended idf_tools.py install command, it also says that everything is already installed.
What I notice, is that export.sh mentions /usr/bin/python3 as the python interpreter.
But install.sh has already created a python venv by now.
So the python interpreter seems to be wrong, could that be a problem?
This is the output of install.sh, when run in the alpine image:
And this is my Dockerfile:Detecting the Python interpreter
Checking "python3" ...
Python 3.11.6
"python3" has been detected
Checking Python compatibility
Installing ESP-IDF tools
Current system platform: linux-amd64
Updating /home/idftester/.espressif/idf-env.json
Selected targets are: esp32h2, esp32, esp32c3, esp32c2, esp32s3, esp32c6, esp32s2
Installing tools: xtensa-esp-elf-gdb, riscv32-esp-elf-gdb, xtensa-esp32-elf, xtensa-esp32s2-elf, xtensa-esp32s3-elf, riscv32-esp-elf, esp32ulp-elf, openocd-esp32, esp-rom-elfs
Installing xtensa-esp-elf-gdb@12.1_20221002
Downloading https://github.com/espressif/binutils-g ... gnu.tar.gz
Destination: /home/idftester/.espressif/dist/xtensa-esp-elf-gdb-12.1_20221002-x86_64-linux-gnu.tar.gz.tmp
Done
Extracting /home/idftester/.espressif/dist/xtensa-esp-elf-gdb-12.1_20221002-x86_64-linux-gnu.tar.gz to /home/idftester/.espressif/tools/xtensa-esp-elf-gdb/12.1_20221002
Installing riscv32-esp-elf-gdb@12.1_20221002
Downloading https://github.com/espressif/binutils-g ... gnu.tar.gz
Destination: /home/idftester/.espressif/dist/riscv32-esp-elf-gdb-12.1_20221002-x86_64-linux-gnu.tar.gz.tmp
Done
Extracting /home/idftester/.espressif/dist/riscv32-esp-elf-gdb-12.1_20221002-x86_64-linux-gnu.tar.gz to /home/idftester/.espressif/tools/riscv32-esp-elf-gdb/12.1_20221002
Installing xtensa-esp32-elf@esp-12.2.0_20230208
Downloading https://github.com/espressif/crosstool- ... gnu.tar.xz
Destination: /home/idftester/.espressif/dist/xtensa-esp32-elf-12.2.0_20230208-x86_64-linux-gnu.tar.xz.tmp
Done
Extracting /home/idftester/.espressif/dist/xtensa-esp32-elf-12.2.0_20230208-x86_64-linux-gnu.tar.xz to /home/idftester/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208
Installing xtensa-esp32s2-elf@esp-12.2.0_20230208
Downloading https://github.com/espressif/crosstool- ... gnu.tar.xz
Destination: /home/idftester/.espressif/dist/xtensa-esp32s2-elf-12.2.0_20230208-x86_64-linux-gnu.tar.xz.tmp
Done
Extracting /home/idftester/.espressif/dist/xtensa-esp32s2-elf-12.2.0_20230208-x86_64-linux-gnu.tar.xz to /home/idftester/.espressif/tools/xtensa-esp32s2-elf/esp-12.2.0_20230208
Installing xtensa-esp32s3-elf@esp-12.2.0_20230208
Downloading https://github.com/espressif/crosstool- ... gnu.tar.xz
Destination: /home/idftester/.espressif/dist/xtensa-esp32s3-elf-12.2.0_20230208-x86_64-linux-gnu.tar.xz.tmp
Done
Extracting /home/idftester/.espressif/dist/xtensa-esp32s3-elf-12.2.0_20230208-x86_64-linux-gnu.tar.xz to /home/idftester/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208
Installing riscv32-esp-elf@esp-12.2.0_20230208
Downloading https://github.com/espressif/crosstool- ... gnu.tar.xz
Destination: /home/idftester/.espressif/dist/riscv32-esp-elf-12.2.0_20230208-x86_64-linux-gnu.tar.xz.tmp
Done
Extracting /home/idftester/.espressif/dist/riscv32-esp-elf-12.2.0_20230208-x86_64-linux-gnu.tar.xz to /home/idftester/.espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208
Installing esp32ulp-elf@2.35_20220830
Downloading https://github.com/espressif/binutils-g ... d64.tar.gz
Destination: /home/idftester/.espressif/dist/esp32ulp-elf-2.35_20220830-linux-amd64.tar.gz.tmp
Done
Extracting /home/idftester/.espressif/dist/esp32ulp-elf-2.35_20220830-linux-amd64.tar.gz to /home/idftester/.espressif/tools/esp32ulp-elf/2.35_20220830
Installing openocd-esp32@v0.12.0-esp32-20230921
Downloading https://github.com/espressif/openocd-es ... 921.tar.gz
Destination: /home/idftester/.espressif/dist/openocd-esp32-linux-amd64-0.12.0-esp32-20230921.tar.gz.tmp
Done
Extracting /home/idftester/.espressif/dist/openocd-esp32-linux-amd64-0.12.0-esp32-20230921.tar.gz to /home/idftester/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230921
Installing esp-rom-elfs@20230320
Downloading https://github.com/espressif/esp-rom-el ... 320.tar.gz
Destination: /home/idftester/.espressif/dist/esp-rom-elfs-20230320.tar.gz.tmp
Done
Extracting /home/idftester/.espressif/dist/esp-rom-elfs-20230320.tar.gz to /home/idftester/.espressif/tools/esp-rom-elfs/20230320
Installing Python environment and packages
Creating a new Python environment in /home/idftester/.espressif/python_env/idf5.1_py3.11_env
Downloading https://dl.espressif.com/dl/esp-idf/esp ... s.v5.1.txt
Destination: /home/idftester/.espressif/espidf.constraints.v5.1.txt.tmp
Done
Installing Python packages
Constraint file: /home/idftester/.espressif/espidf.constraints.v5.1.txt
Requirement files:
- /home/idftester/esp-idf/tools/requirements/requirements.core.txt
Looking in indexes: https://pypi.org/simple, https://dl.espressif.com/pypi
Ignoring importlib_metadata: markers 'python_version < "3.8"' don't match your environment
Requirement already satisfied: setuptools in /home/idftester/.espressif/python_env/idf5.1_py3.11_env/lib/python3.11/site-packages (from -r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 3)) (68.2.2)
Collecting packaging (from -r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 4))
Using cached https://dl.espressif.com/pypi/packaging ... ne-any.whl (53 kB)
Collecting click (from -r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 7))
Using cached https://dl.espressif.com/pypi/click/cli ... ne-any.whl (97 kB)
Collecting pyserial (from -r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 8))
Using cached https://dl.espressif.com/pypi/pyserial/ ... ne-any.whl (90 kB)
Collecting cryptography (from -r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 9))
Using cached cryptography-39.0.2-cp36-abi3-musllinux_1_1_x86_64.whl (4.3 MB)
Collecting pyparsing (from -r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 10))
Using cached https://dl.espressif.com/pypi/pyparsing ... ne-any.whl (98 kB)
Collecting pyelftools (from -r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 11))
Using cached https://dl.espressif.com/pypi/pyelftool ... ne-any.whl (174 kB)
Collecting idf-component-manager (from -r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 12))
Using cached https://dl.espressif.com/pypi/idf-compo ... ne-any.whl (140 kB)
Collecting esp-coredump (from -r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 13))
Using cached https://dl.espressif.com/pypi/esp-cored ... ne-any.whl (38 kB)
Collecting esptool (from -r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 14))
Using cached https://dl.espressif.com/pypi/esptool/e ... ne-any.whl (361 kB)
Collecting esp-idf-kconfig (from -r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 15))
Using cached https://dl.espressif.com/pypi/esp-idf-k ... ne-any.whl (29 kB)
Collecting esp-idf-monitor (from -r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 16))
Using cached https://dl.espressif.com/pypi/esp-idf-m ... ne-any.whl (44 kB)
Collecting esp-idf-size (from -r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 17))
Using cached esp_idf_size-0.4.3-py3-none-any.whl.metadata (1.4 kB)
Collecting esp-idf-panic-decoder (from -r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 18))
Using cached https://dl.espressif.com/pypi/esp-idf-p ... ne-any.whl (15 kB)
Collecting freertos_gdb (from -r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 21))
Using cached https://dl.espressif.com/pypi/freertos- ... ne-any.whl (14 kB)
Collecting cffi>=1.12 (from cryptography->-r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 9))
Using cached cffi-1.16.0-cp311-cp311-musllinux_1_1_x86_64.whl.metadata (1.5 kB)
Collecting cachecontrol[filecache] (from idf-component-manager->-r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 12))
Using cached https://dl.espressif.com/pypi/cachecont ... ne-any.whl (22 kB)
Collecting colorama (from idf-component-manager->-r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 12))
Using cached https://dl.espressif.com/pypi/colorama/ ... ne-any.whl (25 kB)
Collecting pyyaml (from idf-component-manager->-r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 12))
Using cached PyYAML-6.0.1-cp311-cp311-musllinux_1_1_x86_64.whl.metadata (2.1 kB)
Collecting requests (from idf-component-manager->-r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 12))
Using cached https://dl.espressif.com/pypi/requests/ ... ne-any.whl (62 kB)
Collecting requests-file (from idf-component-manager->-r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 12))
Using cached https://dl.espressif.com/pypi/requests- ... ne-any.whl (3.7 kB)
Collecting requests-toolbelt (from idf-component-manager->-r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 12))
Using cached https://dl.espressif.com/pypi/requests- ... ne-any.whl (54 kB)
Collecting schema (from idf-component-manager->-r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 12))
Using cached https://dl.espressif.com/pypi/schema/sc ... ne-any.whl (17 kB)
Collecting six (from idf-component-manager->-r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 12))
Using cached https://dl.espressif.com/pypi/six/six-1 ... ne-any.whl (11 kB)
Collecting tqdm (from idf-component-manager->-r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 12))
Using cached https://dl.espressif.com/pypi/tqdm/tqdm ... ne-any.whl (78 kB)
Collecting urllib3<2 (from idf-component-manager->-r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 12))
Using cached https://dl.espressif.com/pypi/urllib3/u ... ne-any.whl (143 kB)
Collecting construct~=2.10 (from esp-coredump->-r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 13))
Using cached https://dl.espressif.com/pypi/construct ... ne-any.whl (62 kB)
Collecting pygdbmi>=0.9.0.2 (from esp-coredump->-r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 13))
Using cached https://dl.espressif.com/pypi/pygdbmi/p ... ne-any.whl (16 kB)
Collecting bitstring>=3.1.6 (from esptool->-r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 14))
Using cached https://dl.espressif.com/pypi/bitstring ... ne-any.whl (59 kB)
Collecting ecdsa>=0.16.0 (from esptool->-r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 14))
Using cached https://dl.espressif.com/pypi/ecdsa/ecd ... ne-any.whl (142 kB)
Collecting reedsolo<1.8,>=1.5.3 (from esptool->-r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 14))
Using cached https://dl.espressif.com/pypi/reedsolo/ ... ne-any.whl (32 kB)
Collecting kconfiglib>=13.7.1 (from esp-idf-kconfig->-r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 15))
Using cached https://dl.espressif.com/pypi/kconfigli ... ne-any.whl (145 kB)
Collecting bitarray<3.0.0,>=2.8.0 (from bitstring>=3.1.6->esptool->-r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 14))
Using cached bitarray-2.8.2-cp311-cp311-musllinux_1_1_x86_64.whl.metadata (32 kB)
Collecting pycparser (from cffi>=1.12->cryptography->-r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 9))
Using cached https://dl.espressif.com/pypi/pycparser ... ne-any.whl (118 kB)
Collecting msgpack>=0.5.2 (from cachecontrol[filecache]->idf-component-manager->-r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 12))
Using cached msgpack-1.0.7-cp311-cp311-musllinux_1_1_x86_64.whl.metadata (9.1 kB)
Collecting filelock>=3.8.0 (from cachecontrol[filecache]->idf-component-manager->-r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 12))
Using cached https://dl.espressif.com/pypi/filelock/ ... ne-any.whl (11 kB)
Collecting charset-normalizer<4,>=2 (from requests->idf-component-manager->-r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 12))
Using cached charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_x86_64.whl.metadata (33 kB)
Collecting idna<4,>=2.5 (from requests->idf-component-manager->-r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 12))
Using cached https://dl.espressif.com/pypi/idna/idna ... ne-any.whl (61 kB)
Collecting certifi>=2017.4.17 (from requests->idf-component-manager->-r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 12))
Using cached https://dl.espressif.com/pypi/certifi/c ... ne-any.whl (158 kB)
Collecting contextlib2>=0.5.5 (from schema->idf-component-manager->-r /home/idftester/esp-idf/tools/requirements/requirements.core.txt (line 12))
Using cached https://dl.espressif.com/pypi/contextli ... ne-any.whl (13 kB)
Using cached esp_idf_size-0.4.3-py3-none-any.whl (22 kB)
Using cached cffi-1.16.0-cp311-cp311-musllinux_1_1_x86_64.whl (476 kB)
Using cached PyYAML-6.0.1-cp311-cp311-musllinux_1_1_x86_64.whl (748 kB)
Using cached bitarray-2.8.2-cp311-cp311-musllinux_1_1_x86_64.whl (322 kB)
Using cached charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_x86_64.whl (140 kB)
Using cached msgpack-1.0.7-cp311-cp311-musllinux_1_1_x86_64.whl (557 kB)
Installing collected packages: reedsolo, pyserial, pygdbmi, pyelftools, bitarray, urllib3, tqdm, six, pyyaml, pyparsing, pycparser, packaging, msgpack, kconfiglib, idna, freertos_gdb, filelock, esp-idf-panic-decoder, contextlib2, construct, colorama, click,charset-normalizer, certifi, bitstring, schema, requests, esp-idf-size, esp-idf-kconfig, ecdsa, cffi, requests-toolbelt, requests-file, cryptography, cachecontrol, esptool, idf-component-manager, esp-coredump, esp-idf-monitor
Successfully installed bitarray-2.8.2 bitstring-4.1.2 cachecontrol-0.13.1 certifi-2023.7.22 cffi-1.16.0 charset-normalizer-3.3.2click-8.0.4 colorama-0.4.6 construct-2.10.69 contextlib2-21.6.0 cryptography-39.0.2 ecdsa-0.18.0 esp-coredump-1.7.0 esp-idf-kconfig-1.4.0 esp-idf-monitor-1.3.3 esp-idf-panic-decoder-0.2.0 esp-idf-size-0.4.3 esptool-4.7.dev2 filelock-3.13.1 freertos_gdb-1.0.2 idf-component-manager-1.4.1 idna-3.4 kconfiglib-14.1.0 msgpack-1.0.7 packaging-23.2 pycparser-2.21 pyelftools-0.29 pygdbmi-0.9.0.2 pyparsing-3.0.9 pyserial-3.5 pyyaml-6.0.1 reedsolo-1.7.0 requests-2.31.0 requests-file-1.5.1 requests-toolbelt-1.0.0 schema-0.7.5 six-1.16.0 tqdm-4.66.1 urllib3-1.26.18
All done! You can now run:
. ./export.sh
Code: Select all
FROM alpine:3.18.4
RUN apk add --no-cache git wget python3 py3-pip py3-virtualenv cmake ninja-build libbsd-dev flex bison gperf ccache libffi-dev libressl-dev libusb
RUN addgroup -S idftester
RUN adduser -G idftester -S -h /home/idftester idftester
USER idftester
WORKDIR /home/idftester
RUN git clone -b release/v5.1 --recursive https://github.com/espressif/esp-idf.git
WORKDIR /home/idftester/esp-idf
RUN ./install.sh
WORKDIR /home/idftester
RUN printf "export PATH=/usr/lib/ninja-build/bin:$PATH\nalias get_idf='. $HOME/esp-idf/export.sh'" >> .profile
CMD /bin/ash