3 changed files with 62 additions and 0 deletions
@ -0,0 +1,19 @@ |
|||||||
|
FROM debian:stable-slim |
||||||
|
|
||||||
|
RUN apt-get update && \ |
||||||
|
apt-get install -y --no-install-recommends \ |
||||||
|
# dependencies to install flutter |
||||||
|
git curl unzip ca-certificates \ |
||||||
|
# dependencies to build for linux |
||||||
|
clang cmake ninja-build pkg-config libgtk-3-dev \ |
||||||
|
# dependencies for the app |
||||||
|
libayatana-appindicator3-dev |
||||||
|
|
||||||
|
ARG FLUTTER_VERSION |
||||||
|
RUN git clone -b $FLUTTER_VERSION https://github.com/flutter/flutter /flutter |
||||||
|
ENV PATH=$PATH:/flutter/bin |
||||||
|
RUN flutter doctor -v |
||||||
|
RUN flutter precache --linux |
||||||
|
|
||||||
|
ADD docker/build.sh /build.sh |
||||||
|
CMD /build.sh |
@ -0,0 +1,31 @@ |
|||||||
|
#!/bin/bash |
||||||
|
set -euxo pipefail |
||||||
|
cd "$(dirname "$0")/.." |
||||||
|
|
||||||
|
arches=("amd64" "arm64") |
||||||
|
flutter_version="$(jq ".flutterSdkVersion" -r < .fvm/fvm_config.json | cut -d "@" -f 1)" |
||||||
|
|
||||||
|
function cleanup() { |
||||||
|
cd packages/neon |
||||||
|
rm -rf .packages .dart_tool |
||||||
|
fvm flutter pub get |
||||||
|
} |
||||||
|
trap cleanup EXIT |
||||||
|
|
||||||
|
for arch in "${arches[@]}"; do |
||||||
|
docker buildx build \ |
||||||
|
--platform "linux/$arch" \ |
||||||
|
--progress plain \ |
||||||
|
-t "nextcloud-neon-build:$arch" \ |
||||||
|
--build-arg="FLUTTER_VERSION=$flutter_version" \ |
||||||
|
-f tool/Dockerfile.build \ |
||||||
|
./tool |
||||||
|
|
||||||
|
docker run \ |
||||||
|
--platform "linux/$arch" \ |
||||||
|
--rm -it \ |
||||||
|
-e "ORIGINAL_USER=$(id -u)" \ |
||||||
|
-e "ORIGINAL_GROUP=$(id -g)" \ |
||||||
|
-v "$(pwd):/src" \ |
||||||
|
"nextcloud-neon-build:$arch" |
||||||
|
done |
Loading…
Reference in new issue