.gitpod.Dockerfile 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. FROM gitpod/workspace-full-vnc
  2. SHELL ["/bin/bash", "-c"]
  3. # insall flutter and android sdk/ndk/avd/java/gradle
  4. ENV ANDROID_HOME=/home/gitpod/androidsdk \
  5. FLUTTER_VERSION=3.0.5-stable
  6. ENV ANDROID_VERSION=30
  7. # # Install dart
  8. # USER root
  9. # RUN curl -fsSL https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
  10. # && curl -fsSL https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list \
  11. # && install-packages build-essential dart libkrb5-dev gcc make gradle android-tools-adb android-tools-fastboot
  12. # Install flutter
  13. USER gitpod
  14. RUN cd /home/gitpod \
  15. && wget https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${FLUTTER_VERSION}.tar.xz \
  16. && tar -xvf flutter*.tar.xz \
  17. && rm -f flutter*.tar.xz
  18. RUN flutter/bin/flutter precache
  19. RUN echo 'export PATH="$PATH:/home/gitpod/flutter/bin"' >> /home/gitpod/.bashrc
  20. # Install Open JDK
  21. # USER root
  22. # RUN apt update \
  23. # && apt install openjdk-8-jdk -y \
  24. # && update-java-alternatives --set java-1.8.0-openjdk-amd64
  25. USER gitpod
  26. RUN bash -c ". /home/gitpod/.sdkman/bin/sdkman-init.sh && \
  27. sdk install java 17.0.3-ms && \
  28. sdk default java 17.0.3-ms"
  29. # Install SDK Manager
  30. USER gitpod
  31. RUN wget https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip \
  32. && mkdir -p $ANDROID_HOME/cmdline-tools/latest \
  33. && unzip commandlinetools-linux-*.zip -d $ANDROID_HOME \
  34. && rm -f commandlinetools-linux-*.zip \
  35. && mv $ANDROID_HOME/cmdline-tools/bin $ANDROID_HOME/cmdline-tools/latest \
  36. && mv $ANDROID_HOME/cmdline-tools/lib $ANDROID_HOME/cmdline-tools/latest
  37. RUN echo "export ANDROID_HOME=$ANDROID_HOME" >> /home/gitpod/.bashrc \
  38. && echo 'export PATH=$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/cmdline-tools/bin:$ANDROID_HOME/platform-tools:$PATH' >> /home/gitpod/.bashrc
  39. # Install Android Image version $ANDROID_VERSION
  40. USER gitpod
  41. RUN yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "platform-tools" "platforms;android-$ANDROID_VERSION" "emulator" 'build-tools;28.0.3'
  42. RUN yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "system-images;android-$ANDROID_VERSION;google_apis;x86_64"
  43. RUN echo no | $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager create avd -n avd28 -k "system-images;android-$ANDROID_VERSION;google_apis;x86_64"
  44. # Install Google Chrome
  45. USER root
  46. RUN apt-get update \
  47. && apt-get install -y apt-transport-https \
  48. && curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
  49. && echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list \
  50. && apt-get update \
  51. && sudo apt-get install -y google-chrome-stable
  52. # misc deps
  53. RUN apt-get install -y \
  54. libasound2-dev \
  55. libgtk-3-dev \
  56. libnss3-dev \
  57. fonts-noto \
  58. fonts-noto-cjk
  59. # For Qt WebEngine on docker
  60. ENV QTWEBENGINE_DISABLE_SANDBOX 1
  61. USER gitpod
  62. # Install Node and Yarn
  63. ENV NODE_VERSION=10.14
  64. RUN bash -c ". .nvm/nvm.sh && nvm install ${NODE_VERSION} && nvm use ${NODE_VERSION} && nvm alias default ${NODE_VERSION}"
  65. RUN echo "nvm use default &>/dev/null" >> ~/.bashrc.d/51-nvm-fix
  66. RUN npm install -g nativescript@6.5.1