Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added dockerfile for linux and android #407

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions Dockerfile.android
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM ubuntu:18.04

RUN apt update && apt install -y curl git unzip xz-utils zip libglu1-mesa openjdk-8-jdk wget

RUN useradd -ms /bin/bash developer
USER developer
WORKDIR /home/developer

RUN mkdir -p Android/sdk
ENV ANDROID_SDK_ROOT /home/developer/Android/sdk
RUN mkdir -p .android && touch .android/repositories.cfg



# Set up Android SDK
RUN wget -O sdk-tools.zip https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
RUN unzip sdk-tools.zip && rm sdk-tools.zip
RUN mv tools Android/sdk/tools
RUN cd Android/sdk/tools/bin && yes | ./sdkmanager --licenses
RUN cd Android/sdk/tools/bin && ./sdkmanager "build-tools;29.0.2" "patcher;v4" "platform-tools" "platforms;android-29" "sources;android-29"
ENV PATH "$PATH:/home/developer/Android/sdk/platform-tools"

RUN git clone https://github.com/flutter/flutter.git
ENV PATH "$PATH:/home/developer/flutter/bin"
RUN flutter doctor
27 changes: 27 additions & 0 deletions Dockerfile.linux
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM ghcr.io/cirruslabs/flutter:3.24.5

WORKDIR /app

COPY . /app

# Install dependencies for Flutter Linux desktop development
RUN apt-get update && apt-get install -y \
libgtk-3-dev \
libblkid-dev \
liblzma-dev \
liblzma5 \
libnss3 \
libx11-dev \
libxkbfile-dev \
libcurl4-openssl-dev \
xdg-utils \
cmake \
ninja-build \
clang \
&& apt-get clean

RUN flutter doctor

RUN flutter config --enable-linux-desktop
RUN flutter clean
RUN flutter pub get
26 changes: 26 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: "3.9"
services:
flutter_linux:
profiles:
- linux
build:
context: .
dockerfile: Dockerfile.linux
environment:
- DISPLAY=${DISPLAY}
volumes:
- .:/app
network_mode: "host" # Use host networking
command: ["bash", "-c", "flutter clean && flutter run -d linux"]
flutter_android:
profiles:
- android
build:
context: .
dockerfile: Dockerfile.android
environment:
- DISPLAY=${DISPLAY}
volumes:
- .:/app
network_mode: "host" # Use host networking
command: ["bash", "-c", "flutter run -d android"]
Loading