Browse Source

sift-docker.pkg.coding.net/flutter-team/dev-container/dev-allinone:1.0.9-flutter
8880MB

liuyuqi-dellpc 1 year ago
parent
commit
0947b5ce67
1 changed files with 66 additions and 35 deletions
  1. 66 35
      flutter/.ide/Dockerfile-Allinone-flutter

+ 66 - 35
flutter/.ide/Dockerfile-Allinone-flutter

@@ -1,17 +1,16 @@
-FROM openjdk:11 as builder
+FROM ubuntu:24.04 as builder
 
 ENV MAVEN_VERSION=3.9.5 \
     GRADLE_VERSION=7.5
 ARG FLUTTER_VERSION="3.13.5"
 
+USER root
 # apt change to aliyun
-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 sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list.d/ubuntu.sources
+RUN sed -i s@/security.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list.d/ubuntu.sources
 
 RUN apt-get update && apt-get install -y \
-    curl zip unzip wget git vim
-
-RUN apt install build-essential -y
+    curl zip unzip wget git vim build-essential
 
 # install java 21.0.1-ms
 RUN curl -s "https://get.sdkman.io" | bash
@@ -56,7 +55,7 @@ RUN git clone --branch ${FLUTTER_VERSION} https://github.com/flutter/flutter.git
     && ./bin/flutter precache \
     && ./bin/flutter doctor
 
-# install python 3.12.1
+# install python
 RUN mkdir -p ~/.pip
 RUN echo '\n\
     [global] \n\
@@ -64,26 +63,50 @@ RUN echo '\n\
     index-url=https://mirrors.aliyun.com/pypi/simple/ \n\
     ' > ~/.pip/pip.conf
 
-# RUN apt-get install -y software-properties-common
-# RUN add-apt-repository -y ppa:deadsnakes/ppa
-# RUN apt update
-# RUN apt-get install -y python3.12 python3.12-distutils
-# RUN apt install make
-RUN apt install -y python3-pip
-# RUN wget http://npm.taobao.org/mirrors/python/3.12.1/Python-3.12.1.tgz
-# RUN tar -zxf Python-3.12.1.tgz && cd Python-3.12.1 && \
-#     mkdir -p /opt/python/3.12.1 && \
-#     ./configure --prefix=/opt/python/3.12.1 --enable-shared --with-ssl --enable-optimizations && \
-#     make && make install && \
-#     cd .. && rm -rf Python-3.12.1*
-# RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3
-
-# 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
+ARG PYTHON_MAJ_VERSION=3.12
+ARG PYTHON_PATCH_VERSION=1
+ARG PYTHON_VERSION=${PYTHON_MAJ_VERSION}.${PYTHON_PATCH_VERSION}
+
+RUN apt-get update && \
+    apt-get install -y \
+    make \
+    build-essential \
+    libssl-dev \
+    zlib1g-dev \
+    libbz2-dev \
+    libreadline-dev \
+    libsqlite3-dev \
+    curl \
+    llvm \
+    libncurses5-dev \
+    libncursesw5-dev \
+    xz-utils \
+    tk-dev
+RUN curl -O https://mirrors.huaweicloud.com/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz && \
+    tar xzf Python-${PYTHON_VERSION}.tgz && \
+    rm Python-${PYTHON_VERSION}.tgz && \
+    cd Python-${PYTHON_VERSION} && \
+    ./configure --prefix=/opt/python/${PYTHON_VERSION}/ --enable-optimizations --with-lto --with-computed-gotos --with-system-ffi && \
+    make -j "$(nproc)" && \
+    make altinstall
+
+RUN /opt/python/${PYTHON_VERSION}/bin/python${PYTHON_MAJ_VERSION} -m pip install --upgrade pip setuptools wheel poetry && \
+    ln -s /opt/python/${PYTHON_VERSION}/bin/python${PYTHON_MAJ_VERSION}  /opt/python/${PYTHON_VERSION}/bin/python3 && \
+    ln -s /opt/python/${PYTHON_VERSION}/bin/python${PYTHON_MAJ_VERSION}  /opt/python/${PYTHON_VERSION}/bin/python && \
+    ln -s /opt/python/${PYTHON_VERSION}/bin/pydoc${PYTHON_MAJ_VERSION}   /opt/python/${PYTHON_VERSION}/bin/pydoc && \
+    ln -s /opt/python/${PYTHON_VERSION}/bin/idle${PYTHON_MAJ_VERSION}    /opt/python/${PYTHON_VERSION}/bin/idle && \
+    ln -s /opt/python/${PYTHON_VERSION}/bin/python${PYTHON_MAJ_VERSION}-config /opt/python/${PYTHON_VERSION}/bin/python-config
+ENV PATH=/opt/python/${PYTHON_VERSION}/bin:${PATH}
+
+RUN git clone --depth 1 https://github.com/pyenv/pyenv.git ~/.pyenv && \
+    echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc && \
+    echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc && \
+    echo 'eval "$(pyenv init -)"' >> ~/.bashrc
+
+ENV PATH=$PATH:/root/.pyenv/bin
+ENV PYTHON_BUILD_MIRROR_URL_SKIP_CHECKSUM=1
+ENV PYTHON_BUILD_MIRROR_URL=https://mirrors.huaweicloud.com/python/
+# RUN pyenv install ${PYTHON_VERSION} &&  pyenv global ${PYTHON_VERSION}
 
 # install R
 RUN apt-get update && apt-get install -y \
@@ -94,16 +117,22 @@ RUN apt-get update && apt-get install -y \
     ruby-full rubygems ruby-dev
 
 # install rust
+ENV RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static
+ENV RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup
+ENV RUSTUP_DIST_ROOT=https://mirrors.ustc.edu.cn/rust-static
+
 RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
 
-# install .net core 6.0
-# RUN wget https://packages.microsoft.com/config/ubuntu/21.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \
+# # install .net core 6.0
+# RUN wget http://ftp.us.debian.org/debian/pool/main/i/icu/libicu67_67.1-1_amd64.deb && \
+# dpkg -i libicu67_67.1-1_amd64.deb
+# RUN wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \
 #     dpkg -i packages-microsoft-prod.deb && \
 #     rm packages-microsoft-prod.deb && \
 #     apt-get update && \
 #     apt-get install -y apt-transport-https && \
 #     apt-get update && \
-#     apt-get install -y dotnet-sdk-6.0
+#     apt-get install -y dotnet-sdk-6.0 dotnet-runtime-deps-6.0
 
 # install go1.21
 RUN wget https://go.dev/dl/go1.21.4.linux-amd64.tar.gz && \
@@ -116,15 +145,16 @@ 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 config set ELECTRON_MIRROR https://npmmirror.com/mirrors/electron/ --global
-# RUN npm config set ELECTRON_BUILDER_BINARIES_MIRROR https://npmmirror.com/mirrors/electron-builder-binaries/ --global
-RUN npm install -g yarn pnpm
+# npm config set ELECTRON_MIRROR https://npmmirror.com/mirrors/electron/ --global &&\
+# npm config set ELECTRON_BUILDER_BINARIES_MIRROR https://npmmirror.com/mirrors/electron-builder-binaries/ --global
+RUN npm install -g yarn pnpm serve
 
 LABEL email="liuyuqi<liuyuqi.gov@msn.cn>"
 WORKDIR /workspaces
 
 RUN apt-get install -y openssh-server
-RUN rm -rf /var/lib/apt/lists/*
+RUN apt-get clean && \
+    rm -rf /var/lib/apt/lists/*
 
 # 指定字符集支持命令行输入中文(根据需要选择字符集)
 ENV LANG C.UTF-8
@@ -146,7 +176,6 @@ RUN curl -fsSL https://code-server.dev/install.sh | sh &&\
     code-server --install-extension orta.vscode-jest &&\
     code-server --install-extension dbaeumer.vscode-eslint &&\
     code-server --install-extension ms-python.python &&\
-    code-server --install-extension ms-python.vscode-pylance &&\
     code-server --install-extension ms-azuretools.vscode-docker &&\
     code-server --install-extension mhutchie.git-graph &&\
     code-server --install-extension ardisaurus.gitflow-actions-sidebar &&\
@@ -162,7 +191,9 @@ RUN curl -fsSL https://code-server.dev/install.sh | sh &&\
     code-server --install-extension vscjava.vscode-spring-initializr &&\
     echo done
 
+# code-server --install-extension ms-python.vscode-pylance &&\
 # code-server --install-extension ms-dotnettools.csharp &&\
+COPY ./frp /opt/frp
 
 VOLUME [ "/workspaces" ]