-
Notifications
You must be signed in to change notification settings - Fork 48
/
Dockerfile
51 lines (41 loc) · 1.77 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM ubuntu:20.04
# For Chinese users:
# Due to the blocking of GFW firewall, please use the mirror address in ubuntu sources and flutter pub repo.
# uncomment the line below.
# ENV PUB_HOSTED_URL https://pub.flutter-io.cn
# ENV FLUTTER_STORAGE_BASE_URL https://storage.flutter-io.cn
# RUN sed -i s@/archive.ubuntu.com/@/mirrors.163.com/@g /etc/apt/sources.list \
# && sed -i '/security.ubuntu.com/d' /etc/apt/sources.list
RUN apt-get update && apt-get upgrade -y --fix-missing \
&& DEBIAN_FRONTEND="noninteractive" apt install -y tzdata ca-certificates \
netcat curl git unzip xz-utils zip libglu1-mesa openjdk-8-jdk wget
# Set up new user
RUN useradd -ms /bin/bash developer
USER developer
WORKDIR /home/developer
# Prepare Android directories and system variables
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"
# Download Flutter SDK
RUN git clone https://github.com/flutter/flutter.git -b stable --depth=1
ENV PATH "$PATH:/home/developer/flutter/bin"
# Run basic check to download Dark SDK
RUN flutter doctor
RUN flutter precache
RUN mkdir -p src
WORKDIR /home/developer/src
COPY pubspec.yaml ./
RUN flutter pub get
ENTRYPOINT [ "/home/developer/flutter/bin/flutter" ]
# COPY assets/ assets/
# COPY lib/ lib/
# COPY web/ web/
# RUN flutter build web