Dockerfile 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.233.0/containers/java-8/.devcontainer/base.Dockerfile
  2. # [Choice] Java version: 11, 16
  3. ARG VARIANT="16"
  4. FROM mcr.microsoft.com/vscode/devcontainers/java:0-${VARIANT}
  5. # FROM mcr.microsoft.com/devcontainers/universal:2.4.0-focal
  6. # [Option] Install Maven
  7. ARG INSTALL_MAVEN="false"
  8. ARG MAVEN_VERSION=""
  9. ARG INSTALL_JAVA="true"
  10. # [Option] Install Gradle
  11. ARG INSTALL_GRADLE="false"
  12. ARG GRADLE_VERSION="7.5"
  13. # ARG JAVA_VERSION="11.0.12.hs-adpt"
  14. # ARG JAVA_VERSION="8.0.372-tem"
  15. RUN if [ "${INSTALL_MAVEN}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/sdkman/bin/sdkman-init.sh && sdk install maven \"${MAVEN_VERSION}\""; fi \
  16. && if [ "${INSTALL_GRADLE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/sdkman/bin/sdkman-init.sh && sdk install gradle \"${GRADLE_VERSION}\""; fi
  17. # install Java
  18. # RUN if ["${INSTALL_JAVA}" = "true"]; then su vscode -c "umask 0002 && . /usr/local/sdkman/bin/sdkman-init.sh && sdk install java \"${JAVA_VERSION}\""; fi
  19. USER vscode
  20. WORKDIR /home/vscode
  21. ARG FLUTTER_VERSION="3.13.5"
  22. ENV ANDROID_HOME=/home/vscode/androidsdk \
  23. FLUTTER_HOME=/home/vscode/flutter
  24. RUN wget https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip \
  25. && mkdir -p $ANDROID_HOME/cmdline-tools/latest \
  26. && unzip commandlinetools-linux-*.zip -d $ANDROID_HOME \
  27. && rm -f commandlinetools-linux-*.zip \
  28. && mv $ANDROID_HOME/cmdline-tools/bin $ANDROID_HOME/cmdline-tools/latest \
  29. && mv $ANDROID_HOME/cmdline-tools/lib $ANDROID_HOME/cmdline-tools/latest
  30. RUN echo "export ANDROID_HOME=$ANDROID_HOME" >> /home/vscode/.bashrc \
  31. && echo 'export PATH=$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/cmdline-tools/bin:$ANDROID_HOME/platform-tools:$PATH' >> /home/vscode/.bashrc
  32. ENV PATH=$PATH:$FLUTTER_HOME/bin:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/emulator
  33. # Install Android Image version 30
  34. RUN yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "platform-tools" "platforms;android-33"
  35. # RUN yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "system-images;android-30;google_apis;x86_64"
  36. # RUN echo no | $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager create avd -n avd28 -k "system-images;android-30;google_apis;x86_64"
  37. # Install flutter
  38. RUN git clone --branch ${FLUTTER_VERSION} https://github.com/flutter/flutter.git ${FLUTTER_HOME} \
  39. && cd ${FLUTTER_HOME} \
  40. && ./bin/flutter precache \
  41. && ./bin/flutter doctor
  42. # # [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
  43. # ARG NODE_VERSION="lts/*"
  44. # RUN if [ "${NODE_VERSION}" != "none" ]; then umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1; fi