Giter Site home page Giter Site logo

marlin-build's Introduction

Build Marlin firmware using docker

This docker image contains platformio-core and a bash script, for conveniently compiling Marlin firmware with your own configuration.

Compiling firmware

To use this image, you need to provide a folder containing your *.h configuration files. All files with this extension will be copied to the Marlin/ folder, replacing existing configuration files.

Configuration examples for most Marlin based 3d-printers can be found here.

You also need to set the BOARD environment variable, this should contain the default_envs value for your 3d-printer control board. This value can in most cases be found the vendor page/repo, or in firmware guides by the community.

docker-compose

You can create a .env file with the variables BOARD, MARLIN_FIRMWARE and MARLIN_CONFIGURATION next to the docker-compose.yml file, or set the variables in your shell.

There is an example .env file in the examples/ folder.

Run docker-compose run build to compile the marlin firmware.

docker run

You can source a .env file (such as the one provided in the examples/ folder), set the shell variables manually or alter the environment and path arguments with values.

docker run --rm -it \
  -e BOARD \
  -v $MARLIN_FIRMWARE:/home/platformio/build \
  -v $MARLIN_CONFIGURATION:/home/platformio/CustomConfiguration \
  frealmyr/marlin-build:latest

Github Action

You can create a github action that automatically builds and pushes the firmware file when you make a commit containing changes in your CustomConfiguration files.

Simply copy the github-action.yml file provided in Examples/ to .github/workflows/ in your personal repository.

You can alter the folders to your liking. I recommend adding your *.h configuration files to a folder named Firmware/Configuration, and use Firmware/builds for the compiled firmware output. If you make changes to the folder structure, remember to alter the monitored path in the github action yaml.

When you push a commit with configuration changes to master, you can check the yellow dot next to your commit, or navigate to the Actions to view the terminal output for the github action.

A live example of this setup is available here: https://github.com/frealmyr/3d-lab

Docker environment variables

Variable Description Required Default Example
BOARD Platformio default_envs yes "" STM32F103RET6_creality
USE_REPO Compile using a different git repository no "" https://github.com/frealmyr/Marlin
USE_LATEST Update to latest Marlin release tag no "" true
USE_TAG Compile using a specific release tag no "" 2.0.7.1
USE_BRANCH Compile using a branch instead of latest tag no "" bugfix-2.0.x
FW_EXTENSION Override firmware file extension type no bin hex

Different branches and tag versions might use a different CONFIGURATION_H_VERSION, firmware build will fail in such a case. Requiring you to update your configuration files with upstream changes.

Docker volume mounts

Location inside container Description
/home/platformio/build Output folder for compiled firmware
/home/platformio/CustomConfiguration Input folder for custom configuration

marlin-build's People

Contributors

frealmyr avatar ctcdnightmare avatar prostolyubo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.