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.

86 lines
3.6 KiB

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