-
Notifications
You must be signed in to change notification settings - Fork 638
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
base: dev
Are you sure you want to change the base?
Docker build #1754
Conversation
I did version pinning to pass the checks, but I'm not sure if this is a good idea. It will need more maintenance with only little benefits. |
Pins can be relaxed imo. We don't depend on the specific version of node, but gulp. PlatformIO I would keep at 3.6.* instead though. What would the flow be to just update internal sources? docker build --target N-step ? |
Main purpose for the internal source is to install dependencies. Secondary to just build the latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a small issue when user has different UID than 1000. We need to both remap docker-run uid and append HOME env for the npm to cache things, or it will crash when trying to write /.npm
i.e. something like this: ... -e "HOME=/tmp" -u
chown -R worker:worker /espurna && \ | ||
chown -R worker:worker /firmware | ||
|
||
COPY --chown=worker:worker . /espurna |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.dockerignore is needed then (in code/ or at the top?)
we need to ignore platformio build directories
code/.pio
code/.piolibdeps
code/.pioenvs
code/node_modules
and some things from gitignore, vscode & ds_store
```diff diff .gitignore .dockerignore 10,13d9 < credentials.h < node_modules < code/utils < custom.h ´´´
I took a different way in my automated builds (which are still in dev phase, I need to clean up the
My current
|
I make UID and GID configurable. The home directory is inside the image on purpose so that platformio is already ready to build. |
@wsw70 thanks for sharing your current status. I though about using |
I am not really knowledgeable about platformio compilation: why is nodejs needed for a complete build? I use the platformio from python and the firmware compile fine. Is there something I am missing in my compilation? |
@wsw70 If you change some web files gulp is used to shrinks them to gz.h files. |
Which is why I wonder if there is any need to use internal source and keep libraries at all. And we also exchange small git history for docker images :/ There could be another volume exporting toolchain, located at ~/.platformio The part with COPY, pio installs and npm can be removed in favour of customizable entrypoint, either building or installing / updating dependencies. |
Docker build image
This PR 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
Examples
This simple example will build all firmware files from dev branch to /tmp/firmware.
This example will only build firmware for environment
intermittech-quinled
from local files in/home/user/espurna