From a0d9a34182b0b7486ffca673d310f81969cbecb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Gonz=C3=A1lez?= Date: Fri, 9 Jan 2026 09:28:28 +0100 Subject: [PATCH] Va medianamente con podman, no consigo que se creeen muchos containers --- Dockerfile | 27 ++++++++++++++++----------- Makefile | 19 +++++++++++++++++++ docker-compose.yml | 3 ++- firejail-warp-terminal.profile | 11 ----------- pubspec.lock | 4 ++-- warp-terminal.sh | 1 - 6 files changed, 39 insertions(+), 26 deletions(-) create mode 100644 Makefile delete mode 100644 firejail-warp-terminal.profile delete mode 100755 warp-terminal.sh diff --git a/Dockerfile b/Dockerfile index 617e364..89636bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,23 @@ # Use the official Flutter SDK image -FROM cirrusci/flutter:latest +FROM ghcr.io/cirruslabs/flutter:stable + +# Install cmake, ninja, clang, pkg-config for flutter linux +RUN apt-get update && apt-get install -y cmake ninja-build clang pkg-config libgtk-3-dev liblzma-dev -# Set the working directory WORKDIR /app -# Copy the pubspec.yaml and install dependencies +# Configure cache directories +ENV PUB_CACHE=/cache/pub-cache +ENV GRADLE_USER_HOME=/cache/gradle-cache +RUN mkdir -p $PUB_CACHE $GRADLE_USER_HOME + +# Copy pubspec files and get dependencies +# This step is separated to leverage Docker layer caching +# REMEMBER: buld application with Makefile, it builds docker image first COPY pubspec.yaml pubspec.lock ./ RUN flutter pub get -# Copy the rest of the application code -COPY . . - -# Build the Flutter app for Android -RUN flutter build apk --release - -# Use the following entrypoint if you want to run the app in a container -# ENTRYPOINT ["flutter", "run", "--release"] +# Copy the rest of the application code and build +# Commented out to avoid building the app during image creation, this will be handled externally by makefile +# COPY . . +# RUN flutter build apk --release diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c6feabb --- /dev/null +++ b/Makefile @@ -0,0 +1,19 @@ + +build-podman: + podman-compose build + +clean-podman: build-podman + podman-compose run --entrypoint "flutter clean" flutter + + +build-android-release-podman: build-podman + podman-compose run --entrypoint "flutter build apk --release" flutter + +build-linux-debug-podman: build-podman + podman-compose run --entrypoint "flutter build linux" flutter + +run-linux-debug: build-linux-debug-podman + build/linux/x64/debug/bundle/d4rt_formulas + +run-web-release-podman: build-web-release-podman + podman-compose run --entrypoint "cd build/web && python3 -m http.server 8080" flutter diff --git a/docker-compose.yml b/docker-compose.yml index 8a9b978..cd4fe81 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,8 +5,9 @@ services: build: context: . dockerfile: Dockerfile + image: d4rt-formulas-builder volumes: + - ./docker/cache:/cache - .:/app # Link the current directory to /app in the container environment: - FLUTTER_FLAVOR=prod # Example environment variable, adjust as needed - command: flutter build apk --release # You can run any Flutter command here diff --git a/firejail-warp-terminal.profile b/firejail-warp-terminal.profile deleted file mode 100644 index 5406c7b..0000000 --- a/firejail-warp-terminal.profile +++ /dev/null @@ -1,11 +0,0 @@ -# launch as: firejail --profile=firejail-warp-terminal.profile /opt/warpdotdev/warp-terminal/warp -private /home/alvaro/repos/d4rt_formulas/ -blacklist /datos-1T -blacklist /datos-luks/ -blacklist /media - -# net none # disable network -# noroot # don't run as root -caps.drop all # drop Linux capabilities -# seccomp # enable syscall filtering -First version of a formula widget \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index 9ee6b4b..375e3d9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -356,10 +356,10 @@ packages: dependency: transitive description: name: meta - sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.0" mime: dependency: transitive description: diff --git a/warp-terminal.sh b/warp-terminal.sh deleted file mode 100755 index 8471c2f..0000000 --- a/warp-terminal.sh +++ /dev/null @@ -1 +0,0 @@ -firejail --profile=firejail-warp-terminal.profile warp-terminal