Last active
August 23, 2024 15:56
-
-
Save rtlsilva/b333e874eed01e97b56eb16431b18109 to your computer and use it in GitHub Desktop.
Flutter VSCode Development Container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| { | |
| "name": "Flutter", | |
| "dockerFile": "Dockerfile", | |
| "extensions": [ | |
| "dart-code.dart-code", | |
| "dart-code.flutter" | |
| ], | |
| "remoteUser": "developer" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM ubuntu:focal | |
| ENV LANG=C.UTF-8 | |
| ENV JAVA_VERSION=17 | |
| # Android SDK | |
| # https://developer.android.com/studio#downloads | |
| ENV ANDROID_CMDLINE_TOOLS_VERSION=11076708 | |
| ENV ANDROID_PLATFORM_VERSION=34 | |
| ENV ANDROID_BUILD_TOOLS_VERSION=34.0.0 | |
| ENV ANDROID_HOME=/opt/android-sdk-linux | |
| ENV PATH=${PATH}:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/emulator | |
| # Flutter SDK | |
| # https://flutter.dev/docs/development/tools/sdk/releases?tab=linux | |
| ENV FLUTTER_CHANNEL=stable | |
| ENV FLUTTER_VERSION=3.16.9 | |
| ENV FLUTTER_URL="https://storage.googleapis.com/flutter_infra_release/releases/$FLUTTER_CHANNEL/linux/flutter_linux_$FLUTTER_VERSION-$FLUTTER_CHANNEL.tar.xz" | |
| ENV FLUTTER_INSTALL_DIR=/opt | |
| ENV FLUTTER_HOME=${FLUTTER_INSTALL_DIR}/flutter | |
| ENV PATH=${PATH}:${FLUTTER_HOME}/bin | |
| ARG USERNAME=developer | |
| ARG USER_UID=1000 | |
| ARG USER_GID=$USER_UID | |
| # install all dependencies | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| RUN apt-get update \ | |
| && apt-get install --yes sudo \ | |
| && apt-get install --yes --no-install-recommends openjdk-$JAVA_VERSION-jdk-headless \ | |
| && apt-get install --yes --no-install-recommends curl unzip sed git bash xz-utils libglvnd0 ssh xauth x11-xserver-utils libpulse0 libxcomposite1 libgl1-mesa-glx \ | |
| && apt-get autoremove -y \ | |
| && apt-get clean -y \ | |
| && rm -rf /var/lib/{apt,dpkg,cache,log} | |
| # Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user. | |
| RUN groupadd --gid $USER_GID $USERNAME \ | |
| && useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME --groups sudo \ | |
| && mkdir -p ${ANDROID_HOME} ${FLUTTER_HOME} \ | |
| && chown -R ${USER_UID}:${USER_GID} ${ANDROID_HOME} ${FLUTTER_HOME} | |
| USER ${USERNAME} | |
| WORKDIR /home/${USERNAME} | |
| # Android SDK | |
| RUN curl -C - --output android-sdk-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_CMDLINE_TOOLS_VERSION}_latest.zip \ | |
| && unzip -q android-sdk-tools.zip -d /tmp \ | |
| && rm android-sdk-tools.zip \ | |
| && mkdir -p ${ANDROID_HOME}/cmdline-tools/latest \ | |
| && mv /tmp/cmdline-tools/* ${ANDROID_HOME}/cmdline-tools/latest \ | |
| && yes | sdkmanager --licenses \ | |
| && touch $HOME/.android/repositories.cfg \ | |
| && sdkmanager platform-tools \ | |
| && sdkmanager "platforms;android-$ANDROID_PLATFORM_VERSION" "build-tools;$ANDROID_BUILD_TOOLS_VERSION" | |
| #&& sdkmanager emulator \ | |
| #&& sdkmanager "system-images;android-$ANDROID_PLATFORM_VERSION;google_apis_playstore;x86" | |
| # Flutter SDK | |
| RUN curl -C - --output flutter.tar.xz ${FLUTTER_URL} \ | |
| && tar xf flutter.tar.xz -C ${FLUTTER_INSTALL_DIR} \ | |
| && rm flutter.tar.xz \ | |
| && flutter --disable-analytics \ | |
| && yes | flutter doctor -v --android-licenses \ | |
| && flutter config --enable-web \ | |
| #&& flutter emulators --create \ | |
| && flutter update-packages |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment