From fe2fca970d96233c1d70e41a1f1d9a8c00653632 Mon Sep 17 00:00:00 2001 From: Kai Jan Kriegel Date: Thu, 29 Dec 2022 02:30:22 +0100 Subject: [PATCH] fix merge fuckup with Dockerfile --- Dockerfile | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 87615f3..9a7a0da 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,16 @@ -# Setup build image for multistage build -FROM rust:bullseye as builder -# install build deps -RUN apt-get update && apt-get upgrade -y -RUN apt-get install -yqq --no-install-recommends capnproto python3 python3-pip -RUN pip3 install paho-mqtt +FROM --platform=$BUILDPLATFORM alpine:latest as copy +ARG TARGETPLATFORM +RUN case "$TARGETPLATFORM" in \ + "linux/arm/v7") echo armv7-unknown-linux-gnueabihf > /rust_target.txt ;; \ + "linux/arm/v6") echo arm-unknown-linux-gnueabihf > /rust_target.txt ;; \ + "linux/arm64") echo aarch64-unknown-linux-gnu > /rust_target.txt ;; \ + "linux/amd64") echo x86_64-unknown-linux-gnu > /rust_target.txt ;; \ + *) exit 1 ;; \ +esac WORKDIR /usr/src/bffh COPY . . -RUN cargo build --release - +RUN cp target/$(cat /rust_target.txt)/release/bffhd ./bffhd.bin # Setup deployable image FROM ubuntu:22.04