-
Notifications
You must be signed in to change notification settings - Fork 42
/
Dockerfile.gitlab
120 lines (99 loc) · 3.72 KB
/
Dockerfile.gitlab
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
FROM registry.ddbuild.io/images/docker:24.0.4-gbi-focal
ENV DEBIAN_FRONTEND=noninteractive
# Set timezone to UTC by default
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime
RUN apt-get update \
&& apt-get -y install openjdk-17-jdk \
&& rm -rf /var/lib/apt/lists/*
RUN set -x \
&& apt-get update \
&& apt-get -y upgrade \
&& apt-get -y install --no-install-recommends \
curl \
git \
unzip \
wget \
xz-utils \
openssh-client \
expect \
python3-distutils \
python3-apt \
&& apt-get -y clean \
&& rm -rf /var/lib/apt/lists/*
# Add Chrome Dependencies
RUN apt-get update && apt-get install -y -q --no-install-recommends \
libgtk-3-dev \
libx11-xcb1 \
libnss3 \
libxss1 \
libasound2 \
libu2f-udev \
libvulkan1 \
fonts-liberation \
libappindicator3-1 \
lsb-release \
xdg-utils \
curl \
ca-certificates \
zip
ENV GRADLE_VERSION 8.1.1
ENV ANDROID_COMPILE_SDK 34
ENV ANDROID_BUILD_TOOLS 34.0.0
ENV ANDROID_SDK_TOOLS 10406996
ENV NDK_VERSION 25.1.8937393
ENV CMAKE_VERSION 3.22.1
ENV DD_TRACER_VERSION 1.26.1
RUN apt update && apt install -y python3
# Install pip for aws
RUN set -x \
&& curl -OL https://bootstrap.pypa.io/get-pip.py \
&& python3 get-pip.py \
&& rm get-pip.py
RUN python3 --version
RUN set -x \
&& pip install awscli
RUN set -x \
&& curl -OL https://s3.amazonaws.com/dd-package-public/dd-package.deb && dpkg -i dd-package.deb && rm dd-package.deb \
&& apt-get update \
&& apt-get -y clean \
&& rm -rf /var/lib/apt/lists/*
# Gradle
RUN \
cd /usr/local && \
curl -L https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip -o gradle-${GRADLE_VERSION}-bin.zip && \
unzip gradle-${GRADLE_VERSION}-bin.zip && \
rm gradle-${GRADLE_VERSION}-bin.zip
# Workaround for
# Warning: File /root/.android/repositories.cfg could not be loaded.
RUN mkdir /root/.android \
&& touch /root/.android/repositories.cfg
# That should be everything needed for root. Switch users for the rest
USER dog
WORKDIR /home/dog
# Android SDK
RUN \
wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_TOOLS}_latest.zip && \
mkdir -p android-sdk-linux/cmdline-tools && \
unzip -d android-sdk-linux/cmdline-tools android-sdk.zip && \
mv android-sdk-linux/cmdline-tools/cmdline-tools android-sdk-linux/cmdline-tools/latest && \
echo y | android-sdk-linux/cmdline-tools/latest/bin/sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}" >/dev/null && \
echo y | android-sdk-linux/cmdline-tools/latest/bin/sdkmanager "platform-tools" >/dev/null && \
echo y | android-sdk-linux/cmdline-tools/latest/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}" >/dev/null && \
echo y | android-sdk-linux/cmdline-tools/latest/bin/sdkmanager --install "ndk;${NDK_VERSION}" >/dev/null && \
echo y | android-sdk-linux/cmdline-tools/latest/bin/sdkmanager --install "cmake;${CMAKE_VERSION}" >/dev/null && \
(yes || true) | android-sdk-linux/cmdline-tools/latest/bin/sdkmanager --licenses
ENV ANDROID_SDK_ROOT /home/dog/android-sdk-linux
ENV ANDROID_HOME /home/dog/android-sdk-linux
ENV GRADLE_HOME /usr/local/gradle-${GRADLE_VERSION}
ENV ANDROID_NDK $ANDROID_SDK_ROOT/ndk/${NDK_VERSION}
ENV PATH $PATH:$GRADLE_HOME/bin
ENV PATH $PATH:$ANDROID_HOME/platform-tools
ENV PATH $PATH:$ANDROID_SDK_ROOT/build-tools/${ANDROID_BUILD_TOOLS}:$ANDROID_NDK
ENV FLUTTER_VERSION 3.16.9
# Install flutter
RUN \
wget --quiet --output-document=flutter-sdk.tar.xz https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${FLUTTER_VERSION}-stable.tar.xz && \
tar xf flutter-sdk.tar.xz
ENV PATH $PATH:/home/dog/flutter/bin
RUN \
flutter precache