toxcore/other/docker/esp32/Dockerfile
iphydf 6a895be0c7
test: Make esp32 build actually try to instantiate tox.
It doesn't work, because esp32 has too little RAM (320KB). DHT is a
240KB struct, so even just allocating that immediately fails. We'll need
to think carefully about trimming that if we ever want this to work on
embedded devices.
2023-12-19 19:41:45 +00:00

33 lines
1.1 KiB
Docker

FROM mluis/qemu-esp32:latest
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV IDF_TARGET=esp32
WORKDIR /root/toxcore
# Build an initial bootstrap hello world just to compile libsodium and other
# system level dependencies.
COPY other/docker/esp32/sdkconfig \
other/docker/esp32/CMakeLists.txt \
/root/toxcore/
COPY other/docker/esp32/bootstrap/ \
/root/toxcore/main/
RUN . /root/esp/esp-idf/export.sh && idf.py build
# Copy over toxcore sources and build those.
COPY third_party/cmp/ /root/toxcore/main/third_party/cmp/
COPY toxencryptsave/defines.h /root/toxcore/main/toxencryptsave/
COPY toxcore/ /root/toxcore/main/toxcore/
COPY other/docker/esp32/main/CMakeLists.txt \
/root/toxcore/main/
COPY other/docker/esp32/main/*.cc \
other/docker/esp32/main/*.h \
/root/toxcore/main/other/docker/esp32/main/
RUN touch /root/toxcore/main/CMakeLists.txt \
&& . /root/esp/esp-idf/export.sh && idf.py build
RUN ls -lh build/toxcore.bin \
&& sha512sum build/toxcore.bin
RUN /root/flash.sh build/toxcore.bin
COPY other/docker/esp32/qemu-test /root/toxcore/
RUN ["/root/toxcore/qemu-test"]