[build] adding docker images

This commit is contained in:
Petr Pokorny
2020-12-20 12:42:37 +01:00
parent 41f0be34e7
commit 62eedd197f
13 changed files with 108 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
```
docker build -t maptiler/android-base -f android-base .
docker build -t maptiler/android-ndk-r21b -f android-ndk-r21b .
```

View File

@@ -0,0 +1,57 @@
FROM ubuntu:xenial-20181005
ENV DEBIAN_FRONTEND="noninteractive"
# Add base filesystems
ADD filesystem/libsysconfcpus.tar.gz \
filesystem/apt-google-cloud-sdk.tar.gz \
/
# libsysconfcpus.so can be used to alter the number of CPUs reported by the system
ENV LD_PRELOAD=/usr/lib/libsysconfcpus.so
# Add apt keys
RUN set -eu \
&& (find /tmp/*.gpg | xargs -n1 apt-key add) \
&& rm /tmp/*.gpg
# Install base packages
RUN set -eu \
&& apt-get update \
&& apt-get -y install software-properties-common \
&& apt-get update \
&& add-apt-repository -y ppa:git-core/ppa \
&& apt-get update \
&& apt-get -y install git curl make python3 python3-pip zip unzip ccache openjdk-8-jdk-headless apt-transport-https \
&& update-alternatives --install /usr/bin/python python /usr/bin/python3 1 \
&& rm -rf /var/lib/apt/lists/*
# Install CLI tools for CI scripting
RUN set -eu \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0 \
&& apt-add-repository https://cli.github.com/packages \
&& apt-get update \
&& apt-get -y install jq gh \
&& rm -rf /var/lib/apt/lists/*
# Install Google Cloud SDK
RUN set -eu \
&& apt-get update \
&& apt-get -y install google-cloud-sdk \
&& rm -rf /var/lib/apt/lists/*
# Install awscli
RUN set -eu \
&& pip3 install awscli
# Install Node.js
# Check https://nodejs.org/en/download/releases/ for releases
ENV NVM_DIR="/root/.nvm" \
PATH="/root/.nvm/versions/node/v10.13.0/bin:$PATH"
RUN set -e \
&& git -c advice.detachedHead=false clone https://github.com/creationix/nvm.git -b v0.33.11 --depth=1 "$NVM_DIR" \
&& . "$NVM_DIR/nvm.sh" \
&& nvm install v10.13.0
ENV ANDROID_NDK_HOME=/android/sdk/ndk-bundle \
ANDROID_HOME=/android/sdk \
GRADLE_OPTS=-Dorg.gradle.daemon=false

View File

@@ -0,0 +1,41 @@
FROM ghcr.io/maptiler/android-base
WORKDIR /android/sdk
# Install Android SDK
# Use most recent version from https://developer.android.com/studio/index.html#command-tools
# and update the checksum.
RUN set -eu \
&& curl -L --retry 3 https://dl.google.com/android/repository/commandlinetools-linux-6200805_latest.zip -o tools.zip \
&& (echo "f10f9d5bca53cc27e2d210be2cbc7c0f1ee906ad9b868748d74d62e10f2c8275 tools.zip" | sha256sum -c) \
&& unzip -q tools.zip && rm tools.zip
# Install Android NDK
# Use desired version from https://developer.android.com/ndk/downloads/index.html
# and update the checksum.
RUN set -eu \
&& curl -L --retry 3 https://dl.google.com/android/repository/android-ndk-r21-linux-x86_64.zip -o ndk.zip \
&& (echo "afc9c0b9faad222898ac8168c78ad4ccac8a1b5c ndk.zip" | sha1sum -c) \
&& unzip -q ndk.zip && rm ndk.zip && mv android-ndk-r* ndk-bundle
# Install dependencies and build tools
RUN set -eu \
&& mkdir -p "${ANDROID_HOME}/licenses" \
&& echo "24333f8a63b6825ea9c5514f83c2829b004d1fee" > "${ANDROID_HOME}/licenses/android-sdk-license" \
&& tools/bin/sdkmanager \
"--sdk_root=${ANDROID_HOME}" \
"platform-tools" \
"platforms;android-29" \
"build-tools;29.0.2" \
"build-tools;29.0.3" \
"platforms;android-28" \
"build-tools;28.0.3" \
"extras;android;m2repository" \
"patcher;v4" \
"extras;google;m2repository" \
"extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2" \
"cmake;3.10.2.4988404" \
&& rm -rf "${ANDROID_HOME}/licenses"
WORKDIR /src

Binary file not shown.

View File

@@ -0,0 +1 @@
deb http://packages.cloud.google.com/apt cloud-sdk-xenial main

View File

@@ -0,0 +1,2 @@
deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main
deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main

View File

@@ -0,0 +1,2 @@
deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main
deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main

Binary file not shown.

Binary file not shown.