1.注册阿里云账号 https://www.aliyun.com,然后点击产品分类,搜索:容器镜像服务,点击管理控制台,进入到docker服务主页。

2.点击新建镜像仓库,会先register,创建你的docker客户端,访问的用户名,密码。
3.创建命名空间。

idea springboot项目打包上传
1.maven依赖
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.3.6</version>
<configuration>
<repository>${project.artifactId}</repository>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
</configuration>
</plugin>
2.docker file
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]
3.打tag,上传阿里云。
mvn package dockerfile:build -e -DskipTests docker login --username=bupt910 registry.cn-hangzhou.aliyuncs.com docker tag pcs-consult:latest registry.cn-hangzhou.aliyuncs.com/bupt-pcs/pcs:consult docker push registry.cn-hangzhou.aliyuncs.com/bupt-pcs/pcs:consult
原文:https://www.cnblogs.com/wzzxz/p/12156948.html