Open Janoz-NL opened 2 years ago
mkdir /.platformio
chown -R 1000:1000 /.platformio/
chown -R 1000:1000 /piolibs/
Also encountered this issue as I don't want to run HA or esphome in privileged mode. To expand on the already-provided solution:
1) In docker host:
# Get the name of your docker container
docker ps
# Enter the container using a root bash shell (esphome is the name of my container)
docker exec -u root -it esphome /bin/bash
2) Now, as root within the container, run the commands as provided by @tomaszduda23:
mkdir /.platformio chown -R 1000:1000 /.platformio/ chown -R 1000:1000 /piolibs/
3) Rerun the build you attempted, which should now work.
This worked for me: I added these Environment variables to the esphome service:
environment:
PLATFORMIO_CORE_DIR: .plattformio
PLATFORMIO_GLOBALLIB_DIR: .plattformioLibs
Both dir names are in reverence to your /config dir. So you don't have to change directory ownership in the container and it will also work after you rebuild the container.
This worked for me: I added these Environment variables to the esphome service:
environment: PLATFORMIO_CORE_DIR: .plattformio PLATFORMIO_GLOBALLIB_DIR: .plattformioLibs
Both dir names are in reverence to your /config dir. So you don't have to change directory ownership in the container and it will also work after you rebuild the container.
I've had the same issue with 'v2023.5.1' and this fixed it for me. Why is this necessary?
Same issue in 2023.8.0; adding the platformio env vars did the trick for me too. :+1:
Agreed, these should probably point to the cache directory by default, or at least the config
I'm also getting the following warning during build (in addition to the errors mentioned above):
WARNING: The directory '/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
Adding PIP_CACHE_DIR: "/config/.pip"
to the environment seems to fix the issue.
The problem
Docker image requires root. When running the container using --user the compilation of the images give persmission denied errors. Had to change ownership of /.platformio and /piolibs within the container to fix this.
Which version of ESPHome has the issue?
2022.8.1
What type of installation are you using?
Docker
Which version of Home Assistant has the issue?
No response
What platform are you using?
ESP8266
Board
No response
Component causing the issue
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response