FROM ubuntu:24.04 as builder USER root # apt change to aliyun 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 build-essential # install vnc gui RUN apt update && apt install -y xfce4 tightvncserver #CMD ["vncserver", ":1"] # install java RUN curl -s "https://get.sdkman.io" | bash RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && sdk install java 17.0.11-ms" ENV JAVA_HOME /root/.sdkman/candidates/java/17.0.11-ms ENV PATH=$PATH:$JAVA_HOME/bin ENV MAVEN_VERSION=3.9.5 \ GRADLE_VERSION=7.5 # install gradle RUN wget https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip -P /tmp RUN unzip -d /opt/gradle /tmp/gradle-*.zip && rm -rf /tmp/gradle-*.zip ENV GRADLE_HOME=/opt/gradle/gradle-${GRADLE_VERSION} ENV PATH=$PATH:$GRADLE_HOME/bin # install maven RUN wget https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.zip -P /tmp RUN unzip -d /opt/maven /tmp/apache-maven-*.zip ENV MAVEN_HOME=/opt/maven/apache-maven-${MAVEN_VERSION} ENV PATH=$PATH:$MAVEN_HOME/bin # install android sdk ENV ANDROID_HOME=/opt/androidsdk \ FLUTTER_HOME=/opt/flutter RUN wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_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" >> ~/.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 --verbose "platform-tools" "platforms;android-33" ENV PUB_HOSTED_URL=https://pub.flutter-io.cn ENV FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn # install flutter ARG FLUTTER_VERSION="3.13.5" RUN git clone --branch ${FLUTTER_VERSION} https://github.com/flutter/flutter.git ${FLUTTER_HOME} \ && cd ${FLUTTER_HOME} \ && ./bin/flutter precache \ && ./bin/flutter doctor RUN curl -fsSL https://fvm.app/install.sh | bash # install python RUN mkdir -p ~/.pip RUN echo '\n\ [global] \n\ trusted-host=mirrors.aliyun.com \n\ index-url=https://mirrors.aliyun.com/pypi/simple/ \n\ ' > ~/.pip/pip.conf 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 python3-dev default-libmysqlclient-dev libpq-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} RUN pip install jupyter jupyterlab jupyter_contrib_nbextensions # install R RUN apt-get update && apt-get install -y \ r-base r-base-dev # install ruby 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 ENV PATH="$HOME/.cargo/bin:$PATH" # # 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 dotnet-runtime-deps-6.0 # install go1.21 RUN wget https://go.dev/dl/go1.21.4.linux-amd64.tar.gz && \ tar -C /usr/local -xzf go1.21.4.linux-amd64.tar.gz && \ rm go1.21.4.linux-amd64.tar.gz ENV PATH=$PATH:/usr/local/go/bin ENV GOPROXY="https://goproxy.io,direct" # install nodejs20 RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - RUN apt-get install -y nodejs RUN echo '\n\ registry=http://registry.npm.taobao.org \n\ sass_binary_site=https://npmmirror.com/mirrors/node-sass/ \n\ electron_mirror=https://npmmirror.com/mirrors/electron/ \n\ ELECTRON_BUILDER_BINARIES_MIRROR=https://npmmirror.com/mirrors/electron-builder-binaries/ \n\ ' > ~/.npmrc RUN npm install -g yarn pnpm serve LABEL email="liuyuqi" WORKDIR /workspaces RUN apt-get install -y openssh-server RUN apt-get clean && \ rm -rf /var/lib/apt/lists/* # 指定字符集支持命令行输入中文(根据需要选择字符集) ENV LANG C.UTF-8 ENV LANGUAGE C.UTF-8 # set path RUN echo '\n\ export JAVA_HOME=/root/.sdkman/candidates/java/17.0.11-ms \n\ export PATH=$PATH:$JAVA_HOME/bin \n\ export GRADLE_HOME=/opt/gradle/gradle-${GRADLE_VERSION} \n\ export PATH=$PATH:$GRADLE_HOME/bin \n\ export MAVEN_HOME=/opt/maven/apache-maven-${MAVEN_VERSION} \n\ export PATH=$PATH:$MAVEN_HOME/bin \n\ export FLUTTER_HOME=/opt/flutter \n\ export PUB_HOSTED_URL=https://pub.flutter-io.cn \n\ export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn \n\ export PATH=$PATH:$FLUTTER_HOME/bin \n\ export PATH=$PATH:/opt/python/${PYTHON_VERSION}/bin \n\ export PYTHON_BUILD_MIRROR_URL_SKIP_CHECKSUM=1 \n\ export PYTHON_BUILD_MIRROR_URL=https://mirrors.huaweicloud.com/python/ \n\ export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static \n\ export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup \n\ export RUSTUP_DIST_ROOT=https://mirrors.ustc.edu.cn/rust-static \n\ export PATH=$PATH:/usr/local/go/bin \n\ export GOPROXY="https://goproxy.io,direct" \n\ ' >> ~/.bashrc # install vscode and extension RUN curl -fsSL https://code-server.dev/install.sh | sh &&\ code-server --install-extension redhat.vscode-yaml &&\ 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-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 &&\ code-server --install-extension REditorSupport.r &&\ code-server --install-extension vscjava.vscode-java-pack &&\ code-server --install-extension vscjava.vscode-java-debug &&\ code-server --install-extension vscjava.vscode-java-dependency &&\ code-server --install-extension vscjava.vscode-maven &&\ code-server --install-extension vscjava.vscode-spring-initializr &&\ echo done # install manual # docker run -it --rm -v /workspace:/workspaces sift-docker.pkg.coding.net/flutter-team/dev-container/dev-allinone:1.0.12-flutter /bin/bash RUN code-server --install-extension ms-python.vscode-pylance-2024.6.103.vsix # code-server --install-extension ms-dotnettools.csharp &&\ COPY ./frp /opt/frp VOLUME [ "/workspaces" ] CMD [ "/bin/bash" ]