当前位置:   article > 正文

Docker打包springboot工程镜像_104.18.124.25:443

104.18.124.25:443

Docker创建、运行微服务镜像

 

  1. 本地Maven添加Docker插件往本地Docker上创建、运行镜像

本地环境要求:

     Maven

     Java

     Docker

1)pom添加docker plugin

<properties>

        <docker.image.prefix>springboot</docker.image.prefix>

        <docker.maven.plugin.version> 1.2.2</docker.maven.plugin.version>

    </properties>

 

<!-- Docker maven plugin -->

            <plugin>

                <groupId>com.spotify</groupId>

                <artifactId>docker-maven-plugin</artifactId>

                <version>${docker.maven.plugin.version}</version>

                <configuration>

                    <imageName>${docker.image.prefix}/${project.artifactId}</imageName>

                    <dockerDirectory>src/main/docker</dockerDirectory>

                    <resources>

                        <resource>

                            <targetPath>/</targetPath>

                            <directory>${project.build.directory}</directory>

                            <include>${project.build.finalName}.jar</include>

                        </resource>

                    </resources>

                </config

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/388953
推荐阅读
相关标签
  

闽ICP备14008679号