diff --git a/README.md b/README.md index 3a9fbc2..c0c15e2 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,10 @@ On **macOS** or **Linux** just execute the ffmpeg-android-maker.sh script in ter ~~It is also possible to execute this script on a **Windows** machine with [MSYS2](https://www.msys2.org). You also need to install specific packages to it: *make*, *git*, *diffutils* and *tar*. The script supports both 32-bit and 64-bit versions of Windows. Also see Prerequisites section for necessary software.~~ -Since v2.0.0 the **Windows** support is temporary absent, but soon a Docker image will be available to be used on any host OS. +Since v2.0.0 the MSYS2 support is temporary absent. + +Since v2.1.1 the **Windows** support is done with [Docker](https://www.docker.com) tool. +Check [this WIKI page](https://github.com/Javernaut/ffmpeg-android-maker/wiki/Docker-support) for more info. ## Requirements diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile new file mode 100644 index 0000000..f8f7001 --- /dev/null +++ b/tools/docker/Dockerfile @@ -0,0 +1,45 @@ +FROM ubuntu:19.10 + +# Arguments that can be overridden in 'docker build' command: +# Versions of Android SDK, NDK and CMake +ARG VERSION_SDK=6200805 +ARG VERSION_NDK=21.0.6113669 +ARG VERSION_CMAKE=3.10.2.4988404 + +# The HOME variable isn't available for ENV directive (during building an image). +# So we define one manually. For alpine and ubuntu it should be '/root' +ARG HOME_TWIN=/root + +# Creating mandatory environment variables +ENV ANDROID_SDK_HOME=${HOME_TWIN}/android-sdk +ENV ANDROID_NDK_HOME=${ANDROID_SDK_HOME}/ndk/${VERSION_NDK} + +# Installing basic software +RUN apt-get update && apt-get install -y \ + python3 python3-pip python3-setuptools python3-wheel ninja-build \ + openjdk-8-jdk-headless \ + curl \ + unzip \ + bash \ + nasm \ + pkg-config \ + make + +# Meson has to be installed in a different way +RUN pip3 install meson==0.53.2 + +# Download the Android SDK +RUN curl https://dl.google.com/android/repository/commandlinetools-linux-${VERSION_SDK}_latest.zip --output ${HOME_TWIN}/android-sdk.zip +# Unzip it and remove the archive +RUN mkdir -p ${HOME_TWIN}/android-sdk && \ + unzip -qq ${HOME_TWIN}/android-sdk.zip -d ${HOME_TWIN}/android-sdk && \ + rm ${HOME_TWIN}/android-sdk.zip + +# Installing components through the Android SDK +RUN installAndroidComponent() { yes | ${ANDROID_SDK_HOME}/tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_HOME} $1 > /dev/null; } && \ + installAndroidComponent "ndk;${VERSION_NDK}" && \ + installAndroidComponent "cmake;${VERSION_CMAKE}" + +# The command to be executed when a container is running +# Passing additional arguments to the script is done via FAM_ARGS environment variable +CMD cd /mnt/ffmpeg-android-maker && ./ffmpeg-android-maker.sh ${FAM_ARGS}