Docker image build for renpy release automation https://www.renpy.org/latest.html
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
3.3 KiB

  1. FROM python:3-slim
  2. LABEL maintainer="Drew Short <warrick@sothr.com>"
  3. ARG RENPY_VERSION
  4. ENV SDL_AUDIODRIVER="dummy" \
  5. SDL_VIDEODRIVER="dummy" \
  6. RENPY_DIR="/renpy" \
  7. RENPY_VERSION=${RENPY_VERSION:-"7.3.5"} \
  8. JDK_VERSION=${JDK_VERSION:-"8u242"} \
  9. JDK_BUILD=${JDK_BUILD:-"b08"} \
  10. JAVA_HOME=${JAVA_HOME:-/opt/java} \
  11. ANDROID_SDK_VERSION=${ANDROID_SDK_VERSION:-"sdk-tools-linux-4333796"} \
  12. ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT:-"/renpy/rapt/Sdk"} \
  13. ANDROID_HOME=${ANDROID_SDK_ROOT} \
  14. PATH="$PATH:${JAVA_HOME:-/opt/java}/bin"
  15. # Temp directory and volume mount
  16. RUN mkdir -p /tmp /project
  17. # The default expected volume to work with the Ren'Py project
  18. VOLUME /project
  19. # Install required tooling
  20. RUN apt-get -y update \
  21. && apt-get -y --no-install-recommends install \
  22. bzip2 \
  23. ca-certificates \
  24. curl \
  25. ffmpeg \
  26. jq \
  27. parallel \
  28. procps \
  29. tar \
  30. unzip \
  31. wget \
  32. && rm -Rf /var/lib/apt/lists/*
  33. # Install Java 8
  34. RUN cd /tmp \
  35. && curl -LSo jdk${JDK_VERSION}-${JDK_BUILD}.tgz https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk${JDK_VERSION}-${JDK_BUILD}/OpenJDK8U-jdk_x64_linux_hotspot_${JDK_VERSION}${JDK_BUILD}.tar.gz \
  36. && tar -zxf jdk${JDK_VERSION}-${JDK_BUILD}.tgz \
  37. && mkdir -p ${JAVA_HOME} \
  38. && mv ./jdk${JDK_VERSION}-${JDK_BUILD}/* "${JAVA_HOME}" \
  39. && rm -rf "jdk${JDK_VERSION}-${JDK_BUILD}" "${JDK_VERSION}-${JDK_BUILD}.tgz"
  40. # Install RenPy
  41. RUN cd /tmp \
  42. && curl -LSo renpy-${RENPY_VERSION}-sdk.tar.bz2 https://www.renpy.org/dl/${RENPY_VERSION}/renpy-${RENPY_VERSION}-sdk.tar.bz2 \
  43. && curl -LSo renpy-${RENPY_VERSION}-rapt.zip https://www.renpy.org/dl/${RENPY_VERSION}/renpy-${RENPY_VERSION}-rapt.zip \
  44. && curl -LSo renpy-${RENPY_VERSION}-web.zip https://www.renpy.org/dl/${RENPY_VERSION}/renpy-${RENPY_VERSION}-web.zip \
  45. && tar -xf renpy-${RENPY_VERSION}-sdk.tar.bz2 \
  46. && rm renpy-${RENPY_VERSION}-sdk.tar.bz2 \
  47. && mv renpy-${RENPY_VERSION}-sdk ${RENPY_DIR} \
  48. && unzip renpy-${RENPY_VERSION}-rapt.zip -d ${RENPY_DIR} \
  49. && rm renpy-${RENPY_VERSION}-rapt.zip \
  50. && unzip renpy-${RENPY_VERSION}-web.zip -d ${RENPY_DIR} \
  51. && rm renpy-${RENPY_VERSION}-web.zip
  52. # Export a basic configuration for the build
  53. RUN printf "key.alias=android\nkey.store.password=android\nkey.alias.password=android\nkey.store=${RENPY_DIR}/rapt/android.keystore\nsdk.dir=${ANDROID_SDK_ROOT}\n" > ${RENPY_DIR}/rapt/prototype/local.properties \
  54. && mkdir -p ${RENPY_DIR}/rapt/project \
  55. && cp ${RENPY_DIR}/rapt/prototype/local.properties ${RENPY_DIR}/rapt/project/local.properties
  56. # Install the Android SDK for rapt
  57. RUN cd /tmp \
  58. && curl -LSo ${ANDROID_SDK_VERSION}.zip https://dl.google.com/android/repository/${ANDROID_SDK_VERSION}.zip \
  59. && unzip ${ANDROID_SDK_VERSION}.zip -d ./${ANDROID_SDK_VERSION} \
  60. && mkdir -p ${ANDROID_SDK_ROOT} \
  61. && mv ./${ANDROID_SDK_VERSION}/* ${ANDROID_SDK_ROOT} \
  62. && rm -rf ./${ANDROID_SDK_VERSION} ${ANDROID_SDK_VERSION}.zip
  63. # Accept the Android SDK licenses and install the required tooling
  64. RUN cd ${ANDROID_SDK_ROOT} \
  65. && yes y | tools/bin/sdkmanager --licenses \
  66. && yes y | tools/bin/sdkmanager "platforms;android-28" \
  67. && yes y | tools/bin/sdkmanager "build-tools;27.0.3"
  68. # Precache gradle
  69. RUN cd ${RENPY_DIR}/rapt/prototype \
  70. && ./gradlew --version
  71. WORKDIR $RENPY_DIR