|
@@ -1,9 +1,5 @@
|
|
|
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@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list.d/ubuntu.sources
|
|
@@ -12,10 +8,14 @@ RUN sed -i s@/security.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list.
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
curl zip unzip wget git vim build-essential
|
|
|
|
|
|
-# install java 21.0.1-ms
|
|
|
+# install java
|
|
|
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
|
|
|
+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
|
|
@@ -50,6 +50,7 @@ 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 \
|
|
@@ -139,7 +140,7 @@ 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
|
|
|
-RUN export GOPROXY="https://goproxy.io,direct"
|
|
|
+ENV GOPROXY="https://goproxy.io,direct"
|
|
|
|
|
|
# install nodejs20
|
|
|
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
|
|
@@ -162,10 +163,22 @@ ENV LANGUAGE C.UTF-8
|
|
|
|
|
|
# set path
|
|
|
RUN echo '\n\
|
|
|
- export PATH=$PATH:$GRADLE_HOME/bin \n\
|
|
|
- export JAVA_HOME=/usr/local/openjdk-11 \n\
|
|
|
+ export JAVA_HOME=/root/.sdkman/candidates/java/21.0.1-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
|