Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker build #1754

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM debian:buster-slim

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
python2-minimal=2.7.16-1 \
python-pip=18.1-5 \
python-setuptools=40.8.0-1 \
ca-certificates=20190110 \
nodejs=10.15.2~dfsg-2 \
npm=5.8.0+ds6-4 \
git=1:2.20.1-2 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
mcspr marked this conversation as resolved.
Show resolved Hide resolved
&& npm install -g npm \
&& pip install platformio==3.6.7

RUN groupadd --gid 1000 worker && \
useradd \
--uid 1000 \
--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

USER worker

RUN git clone -b dev https://github.com/xoseperez/espurna.git /espurna

WORKDIR /espurna/code

RUN npm install --only=dev && \
platformio run --target clean

VOLUME ["/espurna", "/firmware"]

ENTRYPOINT ["./build.sh", "-d", "/firmware"]
CMD []
28 changes: 28 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -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 .
```

## Examples

The simples example will build all firmware files from dev branch to /tmp/firmware.
mcspr marked this conversation as resolved.
Show resolved Hide resolved

```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
```