forked from apache/openwhisk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker.xml
39 lines (35 loc) · 1.91 KB
/
docker.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!-- docker helper ant targets -->
<!-- vim: set expandtab ts=4 sw=4 : -->
<project>
<import file="config/config.xml" />
<!-- tag an image from docker.endpoint to match its name if pushed to the registry-->
<!-- images should be tagged regardless of deploy target but this slows down local builds by more than 2 minutes; so skip -->
<target name="tagImage" if="${use.docker.registry}">
<var file="whisk.properties" />
<exec executable="/bin/bash" failonerror="true">
<arg line="${openwhisk.home}/tools/docker/dockerWithRetry.sh ${docker.timeout.short} --host tcp://${docker.endpoint}" />
<arg line="${docker.tls.cmd}" />
<arg line="tag -f ${docker.image.to.push} ${docker.registry}${docker.image.to.push}:${docker.image.tag}" />
</exec>
</target>
<!-- push an image from docker.endpoint to the registry as specified by docker.registry -->
<target name="pushImageToRegistry" depends="tagImage" if="${use.docker.registry}">
<var file="whisk.properties" />
<exec executable="/bin/bash" failonerror="true">
<arg line="${openwhisk.home}/tools/docker/dockerWithRetry.sh ${docker.timeout.long} --host tcp://${docker.endpoint}" />
<arg line="${docker.tls.cmd}" />
<arg line="push ${docker.registry}${docker.image.to.push}:${docker.image.tag}" />
</exec>
</target>
<!-- pull an image from the whisk registry on the main docker endpoint
to another endpoint -->
<target name="pullImageFromRegistry" if="${use.docker.registry}">
<var file="whisk.properties" />
<exec executable="docker" failonerror="true">
<arg value="--host" />
<arg value="tcp://${docker.endpoint}" />
<arg line="${docker.tls.cmd}" />
<arg line="pull ${docker.registry}${docker.image.to.pull}:${docker.image.tag}" />
</exec>
</target>
</project>