From: Matthew Waters Date: Sun, 24 Mar 2019 10:41:31 +0000 (+1100) Subject: docker: add android-specific image X-Git-Tag: 1.19.3~497^2~377 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=497415544b1a8235f0cff6af247e6e1c7eee8fb9;p=platform%2Fupstream%2Fgstreamer.git docker: add android-specific image pre-includes the NDK/SDK --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4ff5835..6b52a41 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -101,6 +101,15 @@ cerbero fedora amd64 docker: DOCKERFILE: "docker/cerbero/Dockerfile-fedora" extends: .base +android docker: + stage: "build docker" + variables: + ARCH: "amd64" + TAG: "android" + CONTEXT_DIR: "docker/android/" + DOCKERFILE: "docker/android/Dockerfile" + extends: .base + include: "gitlab/ci_template.yml" .build local: diff --git a/docker/android/Dockerfile b/docker/android/Dockerfile new file mode 100644 index 0000000..b95dd87 --- /dev/null +++ b/docker/android/Dockerfile @@ -0,0 +1,9 @@ +FROM registry.fedoraproject.org/fedora:29 + +ENV ANDROID_HOME=/android/sdk +ENV ANDROID_NDK_HOME=/android/ndk + +COPY prepare.sh cleanup.sh /root/ + +RUN /usr/bin/sh /root/prepare.sh && \ + /usr/bin/sh /root/cleanup.sh diff --git a/docker/android/cleanup.sh b/docker/android/cleanup.sh new file mode 100644 index 0000000..73d62c7 --- /dev/null +++ b/docker/android/cleanup.sh @@ -0,0 +1,7 @@ +set -eu + +echo "Removing DNF cache" +dnf clean all + +rm -R /root/* +rm -rf /var/cache/dnf /var/log/dnf* diff --git a/docker/android/prepare.sh b/docker/android/prepare.sh new file mode 100644 index 0000000..58335ad --- /dev/null +++ b/docker/android/prepare.sh @@ -0,0 +1,32 @@ +set -eu + +dnf install -y \ + file \ + git-core \ + java-1.8.0-openjdk-devel \ + lbzip2 \ + make \ + pkg-config \ + unzip \ + which + +mkdir -p /android/sources + +curl -o /android/sources/android-ndk.zip https://dl.google.com/android/repository/android-ndk-r18b-linux-x86_64.zip +unzip /android/sources/android-ndk.zip -d ${ANDROID_NDK_HOME}/ +# remove the intermediate versioned directory +mv ${ANDROID_NDK_HOME}/*/* ${ANDROID_NDK_HOME}/ + +curl -o /android/sources/android-sdk-tools.zip https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip +unzip /android/sources/android-sdk-tools.zip -d ${ANDROID_HOME}/ +mkdir -p ${ANDROID_HOME}/licenses + +rm -rf /android/sources + +# Accept licenses. Values taken from: +# ANDROID_HOME=/path/to/android/sdk-tools $ANDROID_HOME/tools/bin/sdkmanager --licenses +echo "601085b94cd77f0b54ff86406957099ebe79c4d6" > ${ANDROID_HOME}/licenses/android-googletv-license +echo "24333f8a63b6825ea9c5514f83c2829b004d1fee" > ${ANDROID_HOME}/licenses/android-sdk-license +echo "84831b9409646a918e30573bab4c9c91346d8abd" > ${ANDROID_HOME}/licenses/android-sdk-preview-license +echo "33b6a2b64607f11b759f320ef9dff4ae5c47d97a" > ${ANDROID_HOME}/licenses/google-gdk-license +echo "e9acab5b5fbb560a72cfaecce8946896ff6aab9d" > ${ANDROID_HOME}/licenses/mips-android-sysimage-license