TeRiTeRi

  1. 首页
  2. 未分类
  3. 正文

java项目maven package自动打包镜像推送到docker

2022年5月25日 2742点热度 0人点赞 0条评论

mavenpackage自动打包镜像推送到docker

pom.xml

            <plugin>
                <groupId>com.google.cloud.tools</groupId>
                <artifactId>jib-maven-plugin</artifactId>
                <configuration>
                    <!-- 拉取所需的基础镜像 - 这里用于运行springboot项目 -->
                    <from>
                        <image>registry.cn-shanghai.aliyuncs.com/xxxxxxx/openjdk:17.0-jdk-buster</image>
                        <auth>
                            <!--在docker-hub或者阿里云上的账号和密码-->
                            <username>xxxxxxxxxx</username>
                            <password>xxxxxxxxxx</password>
                        </auth>
                    </from>
                    <!-- 最后生成的镜像配置 -->
                    <to>
                        <!-- push docer-hub官方仓库。用户名/镜像名:版本号, -->
                        <image>registry.cn-shanghai.aliyuncs.com/xxxxxxx/xxxxxxxxxx</image>
                        <!-- 如果是阿里云的容器镜像仓库,则使用容器的配置 前缀/命名空间/仓库名 -->
                        <!--<image>registry.cn-chengdu.aliyuncs.com/renbaojia/ctfo</image>-->
                        <tags>
                            <tag>${project.version}_${maven.build.timestamp}</tag>
                        </tags>
                        <auth>
                            <!--在docker-hub或者阿里云上的账号和密码-->
                            <username>xxxxxxxxxx</username>
                            <password>xxxxxxxxxx</password>
                        </auth>
                    </to>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>build</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
标签: 暂无
最后更新:2022年5月25日

kamisamak

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

COPYRIGHT © 2023 TeRiTeRi. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang