Dockerfile2 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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] Debian OS version (use bullseye on local arm64/Apple Silicon): buster, bullseye
  3. ARG VARIANT="bullseye"
  4. FROM mcr.microsoft.com/vscode/devcontainers/java:0-8-${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=""
  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="2.10.5"
  16. ENV ANDROID_HOME=/home/vscode/androidsdk \
  17. FLUTTER_HOME=/home/vscode/flutter
  18. RUN wget https://dl.google.com/android/repository/commandlinetools-linux-7583922_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. # Install Android Image version 30
  27. RUN yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "platform-tools" "platforms;android-30"
  28. RUN yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "system-images;android-30;google_apis;x86_64"
  29. # RUN echo no | $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager create avd -n avd28 -k "system-images;android-30;google_apis;x86_64"
  30. # Install flutter
  31. RUN git clone -tag {FLUTTER_VERSION} https://github.com/flutter/flutter.git ${FLUTTER_HOME} \
  32. && cd ${FLUTTER_HOME} \
  33. && ./bin/flutter precache \
  34. && ./bin/flutter doctor
  35. # [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
  36. ARG NODE_VERSION="lts/*"
  37. RUN if [ "${NODE_VERSION}" != "none" ]; then umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1; fi