Giter Site home page Giter Site logo

betaflight / docker-betaflight-build Goto Github PK

View Code? Open in Web Editor NEW
35.0 6.0 21.0 40 KB

Docker container that contains everything required to build the Betaflight firmware

License: GNU General Public License v3.0

Dockerfile 100.00%
betaflight docker

docker-betaflight-build's Introduction

Docker Betaflight build

Docker Pulls Docker Stars License

(Markdown optimised for display in Dockerhub.)

Clone and edit Betaflight locally on your platform. This image will take it from there and turn your code into a binary which you then can flash to your flight controller with the Betaflight Configurator.

Usage

Install Docker

The latest docker platform is available from https://www.docker.com/. If your system does not meet the system requirements for the latest version, check out the Docker Toolbox.

Clone the Betaflight repository

Docker runs on a VirtualBox VM which by default only shares the user directory from the underlying guest OS. On Windows that is c:/Users/<user> and on Mac it's /Users/<user>. Hence, you need to clone the Betaflight repository to your user directory. If you want to place it outside the user directory you need to adjust the VirtualBox VM sharing settings accordingly.

Run this image with Docker

Start Docker and change into the Betaflight source directory (in the Docker console).

First you need to set your working directory in Docker:

For Windows - cd /c/users/<user name>

Next, Clone the Betaflight repository. (Note the below link is for the main Betaflight project. If Cloning a workign Fork, you will need to get the link from the GitHub website.)

To Clone a Github repository git clone https://github.com/betaflight/betaflight.git

To view Branches within a repository git branch -a

To checkout a branch git checkout <branch name>

To pull the branch to your local PC git pull

Then run: docker run --rm -ti -v `pwd`:/opt/betaflight betaflight/betaflight-build

Depending on the performance of your system it takes 1-3min until the compilation finishes. The first time you run this it takes longer because Docker needs to download the image and create a container.

Note for Windows users

(Docker on) Windows handles paths slightly differently. You need to specify the full path to the Betaflight directory in the command and you need to add an extra forward slash (/) to the Windows path. The command thus becomes (c equals C drive i.e. c:):

docker run --rm -it -v c:/Users/<user>/<betaflight>:/opt/betaflight betaflight/betaflight-build

If the Windows path contains spaces it would have to be wrapped in quotes as usual on Windows.

docker run --rm -it -v "c:/Users/joe blogs/<betaflight>":/opt/betaflight betaflight/betaflight-build

Output

The firmware file (.bin or .hex) is created in the obj subfolder of your betaflight source directory.

Options

You can pass optional parameters to the Docker build like so:

docker run -e "<parameter>=value" --rm -it -v `pwd`:/opt/betaflight betaflight/betaflight-build

For Windows: docker run -e "parameter=<value>" --rm -it -v c:/Users/<user>/<any sub-directory names>/betaflight:/opt/betaflight betaflight/betaflight-build

These parameters are supported:

  • TARGET=<target name>: The platform (target) to build, e.g. TARGET=STM32F7X2;
  • OPTIONS=<options>: specify build options to be used as defines during the build.

Special cases:

  • TARGET=all: build all targets (may take a long time);
  • TARGET=test: build and run the unit tests;
  • TARGET=unified: build all Unified Targets;
  • TARGET=unified\zip: build all Unified Targets and pack them into ZIP files (good for adding to GitHub issues);
  • TARGET=pre-push: build representative targets and build and run the tests (do this to check that your changes do not introduce build failures every time before opening a pull request).

Flashing the built binary

Use the Betaflight Configurator Chrome app to flash and configure your firmware.

Support

Don't leave comments on Docker Hub that are intended to be support requests, since Docker Hub doesn't send notifications when you write them. Instead create an issue on GitHub.

docker-betaflight-build's People

Contributors

cmengler avatar haumacher avatar kamnxt avatar kmitchel avatar mikeller avatar si618 avatar spatzengr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

docker-betaflight-build's Issues

Not able to build image.

Hey, I have tried for som time no to make the build with docker.
I have the repository local, in the file path C:/Users/sindr/betaflight

here is my result from cmd;
C:\Users\sindr\betaflight>docker run --rm -it -v "c:/users/sindr/betaflight" betaflight/betaflight-build
/bin/sh: 1: [: =: unexpected operator
/bin/sh: 1: [: =: unexpected operator
/bin/sh: 1: [: =: unexpected operator
/bin/sh: 1: [: =: unexpected operator
/bin/sh: 1: [: =: unexpected operator
make: *** No rule to make target 'clean'. Stop.
make: *** No targets specified and no makefile found. Stop.

C:\Users\sindr\betaflight>docker pull c:\users\sindr\betaflight
invalid reference format

I have tried the file path with and without "", and build it from dub-directories. Have not found any solutions on the Web...

Worth mentioning I'm new to Docker, and followed "Building Betaflight w/ Docker + 4.0 F3 Performance HEX files" from UAV tech guide

"unexpected operator" error when running the hex build command

when running the following hex build command for SPRACINGF3 I'm getting the following message ( on windows 10 )

c:\Users\tzuki\Bfligth>docker run -e "parameter=SPRACINGF3" --rm -it -v c/Users/tzuki/bflight/betaflight:/opt/betaflight betaflight/betaflight-build
/bin/sh: 1: [: =: unexpected operator
/bin/sh: 1: [: =: unexpected operator
/bin/sh: 1: [: =: unexpected operator
/bin/sh: 1: [: =: unexpected operator
/bin/sh: 1: [: =: unexpected operator
make: *** No rule to make target 'clean'. Stop.
make: *** No targets specified and no makefile found. Stop.

Any suggestions?

Compiler error on SITL target

I was trying to build all targets for betaflight/betaflight#6355 with D:\github\betaflight>docker run -e "PLATFORM=ALL" --rm -it -v "//d/github/betaflight":/opt/betaflight betaflight/betaflight-build

Build failed with

Building SIRINFPV succeeded.
Building SITL
make[1]: Entering directory '/opt/betaflight'
make -j ./obj/betaflight_3.5.0_SITL.bin
make[2]: Entering directory '/opt/betaflight'
%% dyad.c
%% (speed optimised) accgyro_fake.c
%% (size optimised) barometer_fake.c
ccache: error: Could not find compiler "gcc" in PATH
ccache: error: Could not find compiler "gcc" in PATH
ccache: error: Could not find compiler "gcc" in PATH
Makefile:305: recipe for target 'obj/main/SITL/drivers/accgyro/accgyro_fake.o' failed
make[2]: *** [obj/main/SITL/drivers/accgyro/accgyro_fake.o] Error 1
make[2]: *** Waiting for unfinished jobs....
Makefile:305: recipe for target 'obj/main/SITL/drivers/barometer/barometer_fake.o' failed
make[2]: *** [obj/main/SITL/drivers/barometer/barometer_fake.o] Error 1
Makefile:305: recipe for target 'obj/main/SITL/./lib/main/dyad/dyad.o' failed
make[2]: *** [obj/main/SITL/./lib/main/dyad/dyad.o] Error 1
%% (size optimised) compass_fake.c
%% (size optimised) serial_tcp.c
ccache: error: Could not find compiler "gcc" in PATH
ccache: error: Could not find compiler "gcc" in PATH
Makefile:305: recipe for target 'obj/main/SITL/drivers/compass/compass_fake.o' failed
make[2]: *** [obj/main/SITL/drivers/compass/compass_fake.o] Error 1
Makefile:305: recipe for target 'obj/main/SITL/drivers/serial_tcp.o' failed
make[2]: *** [obj/main/SITL/drivers/serial_tcp.o] Error 1
make[2]: Leaving directory '/opt/betaflight'
Makefile:412: recipe for target 'binary' failed
make[1]: *** [binary] Error 2
make[1]: Leaving directory '/opt/betaflight'
Makefile:356: recipe for target 'SITL' failed
make: *** [SITL] Error 2

Same error when trying to build just SITL target.
Same error when trying to build upstream/master.
Target builds on my xubuntu vm.

make: *** No rule to make target 'clean'. Stop.

Hello, I know there is a similar issue closed but after having fought for several hours with virtualization and so on, now I am stuck with this error message. I am trying to make a .HEX file from the master betaflight branch that I downloaded on windows 10 via Github desctop. Its located at C:\Users\MiPC\Git\Betaflight

I go into the directory and type: docker run --rm -ti -v pwd:/opt/betaflight betaflight/betaflight-build
make: *** No rule to make target 'clean'. Stop.

I have tried everyhting from adding a TARGET to substituting pwd by the actual path with two slashes in front, with one slash, etc, etc... I am stuck.. can you please help me?
dOCKER

Getting "No rule to make target 'clean'" error.

$ docker run --rm -ti -v `pwd`:/opt/betaflight betaflight/betaflight-build
Unable to find image 'betaflight/betaflight-build:latest' locally
latest: Pulling from betaflight/betaflight-build
d5c6f90da05d: Pull complete 
1300883d87d5: Pull complete 
c220aa3cfc1b: Pull complete 
2e9398f099dc: Pull complete 
dc27a084064f: Pull complete 
3f45b02343a4: Pull complete 
e4ca3691d5a5: Pull complete 
230c87c11e77: Pull complete 
5ac912f2f785: Pull complete 
49a07c48bcd4: Pull complete 
945a9f97e21b: Pull complete 
bb1f9010ede8: Pull complete 
Digest: sha256:8893fc7aebab171c08f191479d60c921e8631c4f53bd65958c8ac587612a88c0
Status: Downloaded newer image for betaflight/betaflight-build:latest
make: *** No rule to make target 'clean'.  Stop.
$ docker run -e "PLATFORM=CC3D" --rm -ti -v `pwd`:/opt/betaflight betaflight/betaflight-build
make: *** No rule to make target 'clean'.  Stop.
$ docker run -e "PLATFORM=ALL" --rm -ti -v `pwd`:/opt/betaflight betaflight/betaflight-build
make: *** No rule to make target 'clean_all'.  Stop.

What am I doing wrong?

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.