1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-29 22:24:26 +00:00

Redo docker build system with buildkit+multi-stage and cache pio packages (#2338)

This commit is contained in:
Otto Winter
2021-09-20 09:07:38 +02:00
committed by GitHub
parent a990898256
commit 272ceadbb0
29 changed files with 295 additions and 293 deletions

18
docker/docker_entrypoint.sh Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
# If /cache is mounted, use that as PIO's coredir
# otherwise use path in /config (so that PIO packages aren't downloaded on each compile)
if [[ -d /cache ]]; then
export PLATFORMIO_CORE_DIR=/cache/platformio
else
export PLATFORMIO_CORE_DIR=/config/.esphome/platformio
fi
if [[ ! -d "${PLATFORMIO_CORE_DIR}" ]]; then
echo "Creating cache directory ${PLATFORMIO_CORE_DIR}"
echo "You can change this behavior by mounting a directory to the container's /cache directory."
mkdir -p "${PLATFORMIO_CORE_DIR}"
fi
exec esphome "$@"