registry.cn-hangzhou.aliyuncs.com/baimeidashu/maven3.8.8-jdk1.8:v1.0
registry.cn-hangzhou.aliyuncs.com/baimeidashu/maven3.8.8-jdk17:v1.0
下载jdk
https://bmshare.oss-cn-beijing.aliyuncs.com/java/jdk1.8.0_191.tar.gz
https://bmshare.oss-cn-beijing.aliyuncs.com/java/jdk-17_linux-x64_bin.tar.gz
maven:
wget https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz
要有阻塞进程,不然容器起来就接着运行完就挂了。
cat Dockerfile
FROM centos:7.9.2009
ADD apache-maven-3.8.8-bin.tar.gz /opt
ADD jdk1.8.0_191.tar.gz /opt
COPY settings.xml /
RUN mv /settings.xml /opt/apache-maven-3.8.8/conf/ -f
ENV JAVA_HOME=/opt/jdk1.8.0_191
ENV MAVEN_HOME=/opt/apache-maven-3.8.8
ENV PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH
RUN java -version
RUN mvn -v
CMD ["tail","-f","/etc/hosts"]
如下:
docker build -t maven-3.8.8:v1.0 -f Dockerfile . --no-cache
推送阿里云
docker tag maven-3.8.8:v1.0 registry.cn-hangzhou.aliyuncs.com/baimeidashu/maven3.8.8-jdk1.8:v1.0
docker push registry.cn-hangzhou.aliyuncs.com/baimeidashu/maven3.8.8-jdk1.8:v1.0
欢迎来撩 : 汇总all