Dockerfile-Allinone 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. FROM openjdk:11 as builder
  2. ENV MAVEN_VERSION=3.9.5 \
  3. GRADLE_VERSION=7.3.3
  4. RUN sed -i s@/deb.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list
  5. RUN sed -i s@/security.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list
  6. RUN apt-get update
  7. # install gradle
  8. RUN wget https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip -P /tmp
  9. RUN unzip -d /opt/gradle /tmp/gradle-*.zip && rm -rf /tmp/gradle-*.zip
  10. ENV GRADLE_HOME=/opt/gradle/gradle-${GRADLE_VERSION}
  11. ENV PATH=$PATH:$GRADLE_HOME/bin
  12. # install maven
  13. RUN wget https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.zip -P /tmp
  14. RUN unzip -d /opt/maven /tmp/apache-maven-*.zip
  15. ENV MAVEN_HOME=/opt/maven/apache-maven-${MAVEN_VERSION}
  16. ENV PATH=$PATH:$MAVEN_HOME/bin
  17. # install python3.8
  18. # RUN apt-get update && \
  19. # apt-get install -y python3.8
  20. RUN mkdir -p ~/.pip
  21. RUN echo '\n\
  22. [global] \n\
  23. trusted-host=mirrors.aliyun.com \n\
  24. index-url=https://mirrors.aliyun.com/pypi/simple/ \n\
  25. ' > ~/.pip/pip.conf
  26. # install go1.21
  27. RUN wget https://go.dev/dl/go1.21.4.linux-amd64.tar.gz && \
  28. tar -C /usr/local -xzf go1.21.4.linux-amd64.tar.gz
  29. ENV PATH=$PATH:/usr/local/go/bin
  30. RUN export GOPROXY="https://goproxy.io,direct"
  31. # install nodejs20
  32. RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
  33. RUN apt-get install -y nodejs
  34. RUN npm config set registry http://registry.npm.taobao.org --global
  35. LABEL email="liuyuqi<liuyuqi.gov@msn.cn>"
  36. WORKDIR /workspaces
  37. # RUN mvn package
  38. VOLUME [ "/workspaces" ]
  39. RUN apt-get install -y wget unzip openssh-server
  40. RUN ln -s /usr/bin/python3.9 /usr/bin/python
  41. # 指定字符集支持命令行输入中文(根据需要选择字符集)
  42. ENV LANG C.UTF-8
  43. ENV LANGUAGE C.UTF-8
  44. # set path
  45. RUN echo '\n\
  46. export PATH=$PATH:$GRADLE_HOME/bin \n\
  47. export JAVA_HOME=/usr/local/openjdk-11 \n\
  48. export PATH=$PATH:$JAVA_HOME/bin \n\
  49. export PATH=$PATH:$MAVEN_HOME/bin \n\
  50. export PATH=$PATH:/usr/local/go/bin \n\
  51. export GOPROXY="https://goproxy.io,direct" \n\
  52. ' >> ~/.bashrc
  53. CMD [ "/bin/bash" ]