|
@@ -1,2 +1,46 @@
|
|
|
+# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.233.0/containers/java-8/.devcontainer/base.Dockerfile
|
|
|
|
|
|
-FROM jianboy/flutter-dev-container:3.7.7
|
|
|
+# [Choice] Java version: 11, 16
|
|
|
+ARG VARIANT="16"
|
|
|
+FROM mcr.microsoft.com/vscode/devcontainers/java:0-${VARIANT}
|
|
|
+
|
|
|
+# [Option] Install Maven
|
|
|
+ARG INSTALL_MAVEN="false"
|
|
|
+ARG MAVEN_VERSION=""
|
|
|
+# [Option] Install Gradle
|
|
|
+ARG INSTALL_GRADLE="false"
|
|
|
+ARG GRADLE_VERSION="7.2.2"
|
|
|
+RUN if [ "${INSTALL_MAVEN}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/sdkman/bin/sdkman-init.sh && sdk install maven \"${MAVEN_VERSION}\""; fi \
|
|
|
+ && if [ "${INSTALL_GRADLE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/sdkman/bin/sdkman-init.sh && sdk install gradle \"${GRADLE_VERSION}\""; fi
|
|
|
+
|
|
|
+USER vscode
|
|
|
+WORKDIR /home/vscode
|
|
|
+ARG FLUTTER_VERSION="3.7.7"
|
|
|
+ENV ANDROID_HOME=/home/vscode/androidsdk \
|
|
|
+ FLUTTER_HOME=/home/vscode/flutter
|
|
|
+
|
|
|
+RUN wget https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip \
|
|
|
+ && mkdir -p $ANDROID_HOME/cmdline-tools/latest \
|
|
|
+ && unzip commandlinetools-linux-*.zip -d $ANDROID_HOME \
|
|
|
+ && rm -f commandlinetools-linux-*.zip \
|
|
|
+ && mv $ANDROID_HOME/cmdline-tools/bin $ANDROID_HOME/cmdline-tools/latest \
|
|
|
+ && mv $ANDROID_HOME/cmdline-tools/lib $ANDROID_HOME/cmdline-tools/latest
|
|
|
+
|
|
|
+RUN echo "export ANDROID_HOME=$ANDROID_HOME" >> /home/vscode/.bashrc \
|
|
|
+ && echo 'export PATH=$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/cmdline-tools/bin:$ANDROID_HOME/platform-tools:$PATH' >> /home/vscode/.bashrc
|
|
|
+
|
|
|
+ENV PATH=$PATH:$FLUTTER_HOME/bin
|
|
|
+# Install Android Image version 30
|
|
|
+RUN yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "platform-tools" "platforms;android-33"
|
|
|
+# RUN yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "system-images;android-30;google_apis;x86_64"
|
|
|
+# RUN echo no | $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager create avd -n avd28 -k "system-images;android-30;google_apis;x86_64"
|
|
|
+
|
|
|
+# Install flutter
|
|
|
+RUN git clone --branch ${FLUTTER_VERSION} https://github.com/flutter/flutter.git ${FLUTTER_HOME} \
|
|
|
+ && cd ${FLUTTER_HOME} \
|
|
|
+ && ./bin/flutter precache \
|
|
|
+ && ./bin/flutter doctor
|
|
|
+
|
|
|
+# # [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
|
|
|
+# ARG NODE_VERSION="lts/*"
|
|
|
+# RUN if [ "${NODE_VERSION}" != "none" ]; then umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1; fi
|