AVR Embedded Container
Developed by Gestell Company - Professional Embedded Solutions
- Overview
- System Architecture
- Prerequisites & Setup
- Directory Structure Guidelines
- Deployment & Compilation
- Understanding Build Artifacts
- Workplace & Enterprise Integration
- Troubleshooting Common Work-Related Problems
- Support & Maintainers
A robust, isolated Docker compilation engine designed to automatically build, test, and package standard C and embedded AVR microcontrollers (like the ATmega328p) via a simple REST API. This system is designed to keep host machines clean of heavy toolchains while providing reliable, standardized builds across teams.
- Client (Deployment Script): Packages the local code into a zip file, parses
build_config.json, and sends both to the server via an HTTP POST request. - Nginx Proxy (Port 80): Receives the request, safely handles large file uploads, and passes it to the internal Flask application.
- Flask App (
app.py): Unzips the code, routes files to the appropriate compilers (avr-gccorgcc), and runs the unit tests in an isolated sandbox. - Results: Packages the compiled binaries (
.hex,.elf,.out) andbuildLog.txtinto aresults.zipand returns it instantly to the client.
- Docker Engine: Docker Desktop (Windows/macOS) or Docker Engine (Linux).
- Terminal Environment: Windows git bash, or a standard Linux/macOS Bash terminal.
To start the factory server:
cd ProjectDeployment/ContainerApp
docker build -t avr-factory .
docker run -d -p 8050:80 --name running-avr-factory avr-factoryFor the build engine to correctly categorize and compile your files, your local firmware projects must follow this folder structure:
Firmware/
βββ src/ <-- Main source code (e.g., main.c, drivers)
βββ test/ <-- Unit tests (prefixed with test_)
β βββ unity/ <-- Unity framework files
βββ CompilingYourProject.sh <-- Your deployment script
Open your terminal inside your project folder and run your script:
Windows: ./CompilingYourProject.sh
Linux/macOS: ./CompilingYourProject.sh
The script will package the code and send it to the container. If no configuration exists, it will prompt you for the target type, MCU, CPU frequency, and compiler flags.
After deployment, extract the downloaded results.zip file:
buildLog.txt: The complete compiler output. Check this first for syntax errors.main.hex: (AVR Only) The compiled firmware ready for flashing viaavrdude.main.elf/main.map: Debugging and memory layout files.test_*.out: Standalone unit test executables. Run these locally to verify logic.
If your workplace enforces strict network proxies, Docker may fail to download base images
or apt packages. You will need to inject your corporate proxy settings into the Dockerfile
before building:
ENV http_proxy="http://proxy.corporate.internal:8080"
ENV https_proxy="http://proxy.corporate.internal:8080"This build system is designed to run headlessly. To integrate with Jenkins, GitLab CI, or
GitHub Actions, commit a pre-configured build_config.json to your repository. The
deployment scripts will automatically detect this file and skip all interactive prompts,
allowing automated nightlies or pull-request validation.
If your engineering team requires specific static analysis tools (e.g., PC-lint, Cppcheck, or
proprietary MISRA checkers), modify the Dockerfile inside ContainerApp. Note that
adding heavy tools may require increasing the Nginx timeout settings in nginx.conf to
prevent dropped connections during long analysis runs. Any changes to the app.py you must review it to make possible working on your case.
The app.py is implemented using python flask and done for Localhost usage not on a Server execution.
If another corporate service (like an internal web portal or telemetry agent) is already bound
to port 8050, the container will fail to start.
Fix: Map the container to a different host port (e.g., 8080):
docker run -d -p 8080:80 --name running-avr-factory avr-factory
Remember to update the $Url variable in your deployment scripts to match the new port.
Enterprise VPNs (like Cisco AnyConnect, Zscaler, or GlobalProtect) can aggressively block
Docker's internal networking bridges. If the deploy script returns Error 000 while the
container is running:
- Open Docker Desktop Settings.
- Ensure "Use VPNKit" or equivalent network bridging options are enabled.
- Alternatively, change the target IP in the deploy script from
127.0.0.1tolocalhostor your machine's physical IPv4 address.
Enterprise Endpoint Detection and Response (EDR) tools (like CrowdStrike or
SentinelOne) often .sh scripts that zip files and make HTTP POST requests
as suspicious behavior.
Fix: Request a folder-level exclusion from your IT department for your firmware
development directory, or compile the scripts into binaries using tools like shc or PS2EXE.
If builds freeze indefinitely, especially during the linking phase of large applications, Docker may be starved of RAM. Fix: Navigate to Docker Desktop Settings > Resources and allocate at least 4GB of RAM and 2 CPU cores to the Docker engine.
Documention Information:
- Documention Name: Gestell-C/AVR_Container
- Documention Reference: Gestell-C/AVR_Container
- Development Company: Gestell - Professional Embedded Solutions
Technical Support: change the Your Email
LinkedIn Company Page: https://www.linkedin.com/company/gestell-company
| Attribute | Value |
|---|---|
| Document Type | |
| Document ID | |
| Document Status | Initial draft |
| Document Version | 0.1 |
| Created Date | 2026-05-2 |
| Last Updated | 2026-05-2 |
| Prepared By | Mohammed Diaa (Intern Engineer) |
| Reviewed By | β |
| Approved By | β |
| Version | Date | Author | Description of Change |
|---|---|---|---|
| 0.1 | 2026-05-2 | Initial draft β all sections filled based on project brief |
Built with β€οΈ by Gestell Team
Empowering the next generation of embedded systems engineers
Copyright Β© 2026 Gestell Company - All Rights Reserved