Dockerfile2 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. # [Option] Install Maven
  6. ARG INSTALL_MAVEN="false"
  7. ARG MAVEN_VERSION=""
  8. # [Option] Install Gradle
  9. ARG INSTALL_GRADLE="false"
  10. ARG GRADLE_VERSION="7.2.2"
  11. RUN if [ "${INSTALL_MAVEN}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/sdkman/bin/sdkman-init.sh && sdk install maven \"${MAVEN_VERSION}\""; fi \
  12. && if [ "${INSTALL_GRADLE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/sdkman/bin/sdkman-init.sh && sdk install gradle \"${GRADLE_VERSION}\""; fi
  13. USER vscode
  14. WORKDIR /home/vscode
  15. ARG FLUTTER_VERSION="3.7.7"
  16. ENV ANDROID_HOME=/home/vscode/androidsdk \
  17. FLUTTER_HOME=/home/vscode/flutter
  18. RUN wget https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip \
  19. && mkdir -p $ANDROID_HOME/cmdline-tools/latest \
  20. && unzip commandlinetools-linux-*.zip -d $ANDROID_HOME \
  21. && rm -f commandlinetools-linux-*.zip \
  22. && mv $ANDROID_HOME/cmdline-tools/bin $ANDROID_HOME/cmdline-tools/latest \
  23. && mv $ANDROID_HOME/cmdline-tools/lib $ANDROID_HOME/cmdline-tools/latest
  24. RUN echo "export ANDROID_HOME=$ANDROID_HOME" >> /home/vscode/.bashrc \
  25. && echo 'export PATH=$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/cmdline-tools/bin:$ANDROID_HOME/platform-tools:$PATH' >> /home/vscode/.bashrc
  26. ENV PATH=$PATH:$FLUTTER_HOME/bin
  27. # Install Android Image version 30
  28. RUN yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "platform-tools" "platforms;android-33"
  29. # RUN yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "system-images;android-30;google_apis;x86_64"
  30. # RUN echo no | $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager create avd -n avd28 -k "system-images;android-30;google_apis;x86_64"
  31. # Install flutter
  32. RUN git clone --branch ${FLUTTER_VERSION} https://github.com/flutter/flutter.git ${FLUTTER_HOME} \
  33. && cd ${FLUTTER_HOME} \
  34. && ./bin/flutter precache \
  35. && ./bin/flutter doctor
  36. # # [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
  37. # ARG NODE_VERSION="lts/*"
  38. # RUN if [ "${NODE_VERSION}" != "none" ]; then umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1; fi