Browse Source

Merge 9c111607a3 into 37d2837937

pull/1754/merge
copyrights 3 months ago
committed by GitHub
parent
commit
3d53f6b5be
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
3 changed files with 86 additions and 0 deletions
  1. +13
    -0
      .dockerignore
  2. +45
    -0
      docker/Dockerfile
  3. +28
    -0
      docker/README.md

+ 13
- 0
.dockerignore View File

@ -0,0 +1,13 @@
*.s#?
*.b#?
.modgit
firmware*
*.gch
.pio*
.clang_complete
.gcc-flags.json
.sconsign.dblite
.python
.env
.DS_Store
.vscode

+ 45
- 0
docker/Dockerfile View File

@ -0,0 +1,45 @@
FROM debian:buster-slim
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
python2-minimal \
python-pip \
python-setuptools \
ca-certificates \
nodejs \
npm \
git \
&& rm -rf /var/lib/apt/lists/* \
&& npm install -g npm \
&& pip install "platformio>=3.6,<3.7"
ARG UID=1000
ARG GID=1000
RUN groupadd --gid $GID worker && \
useradd \
--uid $UID \
--gid worker \
--shell /bin/bash \
--create-home worker
RUN mkdir -p /espurna && \
mkdir -p /firmware && \
chown -R worker:worker /espurna && \
chown -R worker:worker /firmware
COPY --chown=worker:worker . /espurna
USER worker
WORKDIR /espurna/code
RUN npm install --only=dev && \
platformio run --target clean
VOLUME ["/espurna", "/firmware"]
ENTRYPOINT ["./build.sh", "-d", "/firmware"]
CMD []

+ 28
- 0
docker/README.md View File

@ -0,0 +1,28 @@
# Docker build image
This directory contains a docker file for an ESPurna build environment.
Two volumes can be used.
* `/espurna` with ESPurna source code.
* `/firmware` target directory for complied firmware files.
## Build
```bash
docker build -t espurna-build --build-arg UID=$(id -u) --build-arg GID=$(id -g) -f Dockerfile ..
```
## Examples
This simple example will build all firmware files from dev branch to /tmp/firmware.
```bash
docker run --rm -it -v /tmp/firmware/:/firmware espurna-build
```
This example will only build firmware for environment `intermittech-quinled` from local files in `/home/user/espurna`
```bash
docker run --rm -it -v /tmp/firmware/:/firmware -v /home/user/espurna/:/espurna espurna-build intermittech-quinled
```

Loading…
Cancel
Save