-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
32 lines (23 loc) · 917 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# esp8266 base image, repo here: https://github.com/resin-io-library/dependent-base-images/tree/master/esp8266
# See more about resin base images here: http://docs.resin.io/runtime/resin-base-images/
FROM resin/esp8266 AS buildstep
# Set the working directory
WORKDIR /usr/src/app
# Set the board
ENV BOARD esp32dev
# Get the staging version
RUN platformio platform install \
https://github.com/platformio/platform-espressif32.git#feature/stage
# Copy config files to the working directory
COPY platformio.ini ./
# Copy source files to the working directory
COPY src/ ./src
# Copy library files to the working directory
COPY lib/ ./lib
# Compile the firmware
RUN platformio run --environment $BOARD && \
mv .pioenvs/$BOARD/firmware.bin /assets/
# Start with a minimal runtime container
FROM alpine
# Copy the compiled firmware into the empty runtime container
COPY --from=buildstep /assets/ /assets/