forked from esnet/iperf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
52 lines (41 loc) · 1.99 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
52
FROM ubuntu:22.04
LABEL maintainer="[email protected]"
# Update and install dependencies
RUN apt-get -y update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
tzdata make bash git unzip wget curl openjdk-8-jdk build-essential autoconf nano tree python3 libpthread-stubs0-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ARG API_VERSION=31
ARG SDK_VERSION=4333796
ARG NDK_VERSION=r26b
ARG IPERF_VERSION=iperf-3.17.1
ENV ANDROID_SDK_VERSION=${SDK_VERSION}
ENV ANDROID_SDK_HOME=/opt/android-sdk
ENV ANDROID_SDK_FILENAME=sdk-tools-linux-${ANDROID_SDK_VERSION}
ENV ANDROID_SDK_URL=https://dl.google.com/android/repository/${ANDROID_SDK_FILENAME}.zip
# Download and install Android SDK
RUN wget --no-check-certificate -q ${ANDROID_SDK_URL} && \
mkdir -p ${ANDROID_SDK_HOME} && \
unzip -q ${ANDROID_SDK_FILENAME}.zip -d ${ANDROID_SDK_HOME} && \
rm -f ${ANDROID_SDK_FILENAME}.zip
ENV PATH=${PATH}:${ANDROID_SDK_HOME}/tools:${ANDROID_SDK_HOME}/tools/bin:${ANDROID_SDK_HOME}/platform-tools
ENV PATH=${PATH}:/home/nespl/android-ndk-r8
# Accept Android SDK licenses and install required components
RUN yes | sdkmanager --licenses > /dev/null && \
yes | sdkmanager "platforms;android-${API_VERSION}" > /dev/null
ENV ANDROID_NDK_VERSION=${NDK_VERSION}
ENV ANDROID_NDK_HOME=/opt/android-ndk
ENV ANDROID_NDK_FILENAME=android-ndk-${ANDROID_NDK_VERSION}-linux
ENV ANDROID_NDK_URL=https://dl.google.com/android/repository/${ANDROID_NDK_FILENAME}.zip
# Download and install Android NDK
RUN wget --no-check-certificate -q ${ANDROID_NDK_URL} && \
mkdir -p ${ANDROID_NDK_HOME} && \
unzip -q ${ANDROID_NDK_FILENAME}.zip -d ${ANDROID_NDK_HOME} && \
rm -f ${ANDROID_NDK_FILENAME}.zip
ENV PATH=${PATH}:${ANDROID_NDK_HOME}/android-ndk-${NDK_VERSION}/
ENV NDK_PROJECT_PATH=/tmp
COPY . /tmp/iperf
RUN cd /tmp/iperf && ./configure
RUN mkdir -p /tmp/iperf/jniLibs
RUN ndk-build APP_BUILD_SCRIPT=/tmp/iperf/jni/Android.mk NDK_LIBS_OUT=/tmp/iperf/jniLibs