Browse Source

Update 'nodejs/.ide/Dockerfile-Allinone-flutter'

天问 1 year ago
parent
commit
df3fd5dba4
1 changed files with 31 additions and 10 deletions
  1. 31 10
      nodejs/.ide/Dockerfile-Allinone-flutter

+ 31 - 10
nodejs/.ide/Dockerfile-Allinone-flutter

@@ -1,4 +1,4 @@
-FROM openjdk:16 as builder
+FROM openjdk:11 as builder
 
 ENV MAVEN_VERSION=3.9.5 \
     GRADLE_VERSION=7.5
@@ -6,7 +6,15 @@ ARG FLUTTER_VERSION="3.13.5"
 
 RUN sed -i s@/deb.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list
 RUN sed -i s@/security.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list
-RUN apt-get update
+
+RUN apt-get update && apt-get install -y \
+    curl zip wget \
+    && rm -rf /var/lib/apt/lists/*
+
+# install java16
+RUN curl -s "https://get.sdkman.io" | bash
+RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && sdk install java 21.0.1-ms"
+ENV JAVA_HOME root/.sdkman/candidates/java/21.0.1-ms
 
 # install gradle
 RUN wget https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip -P /tmp
@@ -35,7 +43,7 @@ RUN echo "export ANDROID_HOME=$ANDROID_HOME" >> ~/.bashrc \
     && echo 'export PATH=$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/cmdline-tools/bin:$ANDROID_HOME/platform-tools:$PATH' >> ~/.bashrc
 
 ENV PATH=$PATH:$FLUTTER_HOME/bin:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/emulator
-RUN yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "platform-tools" "platforms;android-33"
+RUN yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --verbose "platform-tools" "platforms;android-33"
 
 # install flutter
 RUN git clone --branch ${FLUTTER_VERSION} https://github.com/flutter/flutter.git ${FLUTTER_HOME} \
@@ -43,9 +51,7 @@ RUN git clone --branch ${FLUTTER_VERSION} https://github.com/flutter/flutter.git
     && ./bin/flutter precache \
     && ./bin/flutter doctor
 
-# install python3.8
-# RUN apt-get update && \
-#     apt-get install -y python3.8
+# install python3.10
 RUN mkdir -p ~/.pip
 RUN echo '\n\
     [global] \n\
@@ -53,8 +59,23 @@ RUN echo '\n\
     index-url=https://mirrors.aliyun.com/pypi/simple/ \n\
     ' > ~/.pip/pip.conf
 
-RUN wget http://fileshare.yoqi.me/d/DevFiles/Develop/Python/get-pip.py?sign=17C5fjx9l5VpBJ6FCHonje5nEEkylSINsPlKsASVkRc=:1702263152 -O get-pip.py
-RUN python3 get-pip.py
+# RUN apt-get update && apt-get install -y \
+#     software-properties-common
+
+# RUN add-apt-repository -y ppa:deadsnakes/ppa
+# RUN apt-get update && \
+#     apt-get install -y python3.10 python3.10-distutils
+
+RUN apt update && apt install -y python3-distutils
+
+RUN curl http://fileshare.yoqi.me/d/DevFiles/Develop/Python/get-pip.py?sign=17C5fjx9l5VpBJ6FCHonje5nEEkylSINsPlKsASVkRc=:1702263152 -o get-pip.py && \
+    python3 get-pip.py && \
+    rm get-pip.py
+
+RUN ln -s /usr/bin/python3.9 /usr/bin/python && \
+    ln -s /usr/bin/pip3 /usr/bin/pip
+
+RUN rm -rf /var/lib/apt/lists/*
 
 # install go1.21
 RUN wget https://go.dev/dl/go1.21.4.linux-amd64.tar.gz && \
@@ -66,14 +87,13 @@ RUN export GOPROXY="https://goproxy.io,direct"
 RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
 RUN apt-get install -y nodejs
 RUN npm config set registry http://registry.npm.taobao.org --global
-RUN npm install yarn pnpm
+RUN npm install -g yarn pnpm
 
 LABEL email="liuyuqi<liuyuqi.gov@msn.cn>"
 WORKDIR /workspaces
 # RUN mvn package
 
 RUN apt-get install -y wget unzip openssh-server
-RUN ln -s /usr/bin/python3.9  /usr/bin/python
 
 # 指定字符集支持命令行输入中文(根据需要选择字符集)
 ENV LANG C.UTF-8
@@ -99,6 +119,7 @@ RUN curl -fsSL https://code-server.dev/install.sh | sh &&\
     code-server --install-extension ms-azuretools.vscode-docker &&\
     code-server --install-extension mhutchie.git-graph &&\
     code-server --install-extension ardisaurus.gitflow-actions-sidebar &&\
+    code-server --install-extension Dart-Code.flutter &&\
     code-server --install-extension golang.go &&\
     code-server --install-extension Vue.volar &&\
     code-server --install-extension eamodio.gitlens &&\