Skip to content

Commit 881bc0d

Browse files
committed
add basic Android test container
1 parent 656c40d commit 881bc0d

2 files changed

Lines changed: 101 additions & 0 deletions

File tree

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
FROM ubuntu.azurecr.io/ubuntu:noble AS venv
2+
ENV DEBIAN_FRONTEND=noninteractive
3+
4+
RUN apt-get update && \
5+
apt-get install -y \
6+
cargo \
7+
pkg-config \
8+
libffi-dev \
9+
coreutils \
10+
python3-dev \
11+
python3-pip \
12+
python3-venv \
13+
libssl-dev \
14+
&& rm -rf /var/lib/apt/lists/*
15+
16+
RUN python3 -m venv /venv && \
17+
. /venv/bin/activate && \
18+
pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple && \
19+
pip install ./helix_scripts-*-py3-none-any.whl && \
20+
rm ./helix_scripts-*-py3-none-any.whl
21+
22+
FROM ubuntu.azurecr.io/ubuntu:noble
23+
ARG TARGETARCH
24+
ENV DEBIAN_FRONTEND=noninteractive
25+
26+
RUN apt-get update && \
27+
apt-get install -qq -y \
28+
android-sdk \
29+
autoconf \
30+
automake \
31+
build-essential \
32+
cmake \
33+
clang \
34+
curl \
35+
gcc \
36+
gdb \
37+
git \
38+
gss-ntlmssp \
39+
iputils-ping \
40+
libnuma1 \
41+
libtool \
42+
libunwind8 \
43+
lldb \
44+
llvm \
45+
locales \
46+
locales-all \
47+
openjdk-17-jre \
48+
python3-dev \
49+
python3-pip \
50+
python3-venv \
51+
qemu-kvm \
52+
software-properties-common \
53+
sudo \
54+
tzdata \
55+
unzip \
56+
&& rm -rf /var/lib/apt/lists/* \
57+
\
58+
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
59+
60+
ENV LANG=en_US.utf8
61+
62+
RUN curl "https://netcorenativeassets.blob.core.windows.net/resource-packages/external/linux/android-sdk/commandlinetools-linux-13114758_latest.zip" -o /tmp/commandlinetools.zip && \
63+
mkdir -p /usr/local/android-sdk/cmdline-tools /home/helixbot/.android/avd/android_emu_86_64.avd && \
64+
unzip /tmp/commandlinetools.zip -d /usr/local/android-sdk/cmdline-tools && \
65+
yes | /usr/local/android-sdk/cmdline-tools/cmdline-tools/bin/sdkmanager --licenses && \
66+
/usr/local/android-sdk/cmdline-tools/cmdline-tools/bin/sdkmanager \
67+
--verbose \
68+
"system-images;android-31;default;x86_64" \
69+
"platforms;android-31" \
70+
"platform-tools" \
71+
"emulator" && \
72+
/usr/local/android-sdk/emulator/mksdcard -l "sdcard64" "3072M" /home/helixbot/.android/avd/android_emu_86_64.avd/sdcard.img
73+
74+
75+
# Remove user (probably ubuntu) with UID 1000 to UID 2000 to avoid conflict with helixbot
76+
RUN user_id=$(id -un 1000) && \
77+
/usr/sbin/userdel --force --remove $user_id
78+
79+
# create helixbot user and give rights to sudo without password
80+
RUN /usr/sbin/adduser --disabled-password --gecos '' --uid 1000 --shell /bin/bash --ingroup adm helixbot && \
81+
groupadd -f kvm && \
82+
usermod -a -G kvm helixbot && \
83+
chmod 755 /root && \
84+
echo "helixbot ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/helixbot
85+
86+
USER helixbot
87+

src/ubuntu/manifest.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,20 @@
245245
}
246246
]
247247
},
248+
{
249+
"platforms": [
250+
{
251+
"architecture": "amd64",
252+
"dockerfile": "src/ubuntu/24.04/helix/android/amd64",
253+
"os": "linux",
254+
"osVersion": "noble",
255+
"tags": {
256+
"ubuntu-24.04-helix-android": {},
257+
"ubuntu-24.04-helix-android-amd64": {}
258+
}
259+
}
260+
]
261+
},
248262
{
249263
"platforms": [
250264
{

0 commit comments

Comments
 (0)