From 5f44b66be0234c650b0358a0bda1750f618e7964 Mon Sep 17 00:00:00 2001 From: aanper Date: Fri, 7 Aug 2020 09:51:41 +0300 Subject: [PATCH] add dockerfiles for build --- Dockerfile | 10 ++++++++++ README.md | 13 +++++++++++-- docker-compose.yml | 16 ++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..6c14de55 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM ubuntu:18.04 + +RUN apt-get update && apt-get install -y --no-install-recommends \ +make gcc-arm-none-eabi binutils-arm-none-eabi libnewlib-arm-none-eabi \ +autoconf automake libtool curl wget g++ unzip && \ +apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +RUN apt-get update && apt-get install -y --no-install-recommends \ +python python-pip libstdc++-arm-none-eabi-newlib && \ +apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* diff --git a/README.md b/README.md index 184ab5a9..ca39296b 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,18 @@ Project website: [flipperzero.one](https://flipperzero.one) (add code style, contribution guide here) -## Build +## Building + +### Build in docker container (main way) + +1. Install [docker compose](https://docs.docker.com/compose/install/) +2. After startup you should run `docker-compose up -d` to run the container. +3. Then you can run `docker-compose exec dev make` to build application. + +If Dockerfile is changed you should run `docker-compose down` and `docker-compose build` for rebuild the image. + +### Build in IDE -* docker image * Arduino IDE (in progress) * PlatformIO (in progress) diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..0be371d5 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,16 @@ +version: '3' +services: + dev: + build: . + network_mode: "host" + privileged: true + tty: true + stdin_open: true + volumes: + - .:/project +# - /dev/bus/usb:/dev/bus/usb + # working_dir: "/project/target_nucleo476" + # working_dir: "/project/target_bluepill" + working_dir: "/project/target_prod" + environment: + DISPLAY: $DISPLAY