会员系统网站制作,网站设计沟通,o2o商城,舟山市建设局网站在使用docker-maven-plugin 插件时#xff0c;经常会碰到一些奇怪的问题#xff1a; 比如#xff1a; 1、docker远程访问时#xff0c;认证安全问题#xff1f; 2、dockerHost 访问地址准确性#xff1f; 3、需要多个tag时如何处理#xff1f; 4、push 到仓库时#xf…在使用docker-maven-plugin 插件时经常会碰到一些奇怪的问题 比如 1、docker远程访问时认证安全问题 2、dockerHost 访问地址准确性 3、需要多个tag时如何处理 4、push 到仓库时需要保留历史记录问题 反正各种问题没有找到任何相关资源能完整的说明踩坑之后备忘重点内容直接详细注释说明
!--使用docker-maven-plugin插件--
plugingroupIdcom.spotify/groupIdartifactIddocker-maven-plugin/artifactIdversion1.2.2/versionconfigurationimageName${project.artifactId}:${project.version}/imageName!-- 指定 Dockerfile 路径--dockerDirectory${basedir}/dockerDirectory!-- 这里的tag会在build环境中打上支持多个tag--imageTagsimageTaglatest/imageTag/imageTags-- 根据认证的情况确保是否时http或https默认2375对应http2376对应https--dockerHosthttps://x.x.x.x:2376/dockerHost!--如果docker 已经做的安装认证这里需要放认证客户端访问需要的几个文件默认:ca.key,cert.pem,key.pem--!--注意几个文件的名称必须为如上几个默认的名称,比如把上面几个文件放在/home/xxxx/cert--dockerCertPath/home/xxxx/cert/dockerCertPathexecutionsexecutionidbuild-image/idphasepackage/phasegoalsgoalbuild/goal/goals/executionexecutionidtag-image/idphasepackage/phasegoalsgoaltag/goal/goalsconfigurationimage${project.artifactId}:${project.version}/imagenewName${docker.repostory}/${docker.registry.namespace}/${project.artifactId}:latest/newName/configuration/executionexecutionidpush-image/idphaseverify/phasegoalsgoalpush/goal/goalsconfiguration!--如果有设置maven settting这里是setting中的server id如果自己的私服也可以是任意值请根据实际配置--serverId${docker.serverId}/serverIdimageName${docker.repostory}/${docker.registry.namespace}/${project.artifactId}:latest/imageName!--这里就可以在push 多个tag到仓库注意前提是已经存在该tag的image--imageTagsimageTag${project.version}/imageTagimageTaglatest/imageTag/imageTags/configuration/execution/executions
/plugin