|
由于网络上没有发现完整的实例,所以自己摸索后记录如下。
1、docker push命令的使用,通常先去docker tag命令,将需要push的注册表添加到tag中,从而添加后续的直接docker push image。
先决条件:docker客户端首先登录注册表(或包含该注册表的身份认证),例如运行docker login或直接更改身份认证文件。不是这个部分,我不再说了。
docker image tag rhel-httpd 3360 latest registry-host 33605000/my admin/rhel-httpd 3360 latest
docker image push registry-host 33605000/my admin/rhel-httpd 3360 latest
有关详细信息,请访问https://docs . docker.com/engine/reference/commandline/push/
2、使用插件io.fabric 8 docker maven插件:
Plugin
GroupIdio.fabric8/groupId
工件docker-maven-plugin/工件id
版本0.33.0/版本
s="token punctuation">>
configuration>
images>
image>
name>registry的地址/项目:${TAG}name>
alias>masteralias>
build>
dockerFile>dir/DockerfiledockerFile>
buildOptions>
network>hostnetwork>
buildOptions>
build>
image>
image>
...
image>
images>
authConfig>
username>认证的用户名username>
password>认证的密码password>
authConfig>
configuration>
executions>
execution>
id>docker-execid>
phase>installphase>
goals>
goal>buildgoal>
goal>pushgoal>
goals>
execution>
executions>
plugin> |
|