Procházet zdrojové kódy

add dockerfiles for build

aanper před 5 roky
rodič
revize
5f44b66be0
3 změnil soubory, kde provedl 37 přidání a 2 odebrání
  1. 10 0
      Dockerfile
  2. 11 2
      README.md
  3. 16 0
      docker-compose.yml

+ 10 - 0
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/*

+ 11 - 2
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)
 

+ 16 - 0
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