Pushing a docker image into Artifactory via the publishing mechanism in gradle
<p>We are using the <a href="https://www.jfrog.com/confluence/display/RTF/Gradle+Artifactory+Plugin" rel="noreferrer">Gradle Artifactory Plugin</a> to publish artifacts into our Artifactory server (see also these <a href="https://www.jfrog.com/confluence/display/RTF/Working+with+Gradle" rel="noreferrer">instructions</a>).</p>

<p>Now we have added tasks into our Gradle scripts to build Docker images and we want to push these images into our Artifactory (which we have configured as a Docker repository).</p>

<p>I've managed to do this using custom tasks but I would really like to plug this into our current workflow so that <code>gradle artifactoryPublish</code> does this at the same time that it uploads our other artifacts into the repository. The main benefit of doing this would be that the publishing mechanism makes sure that all modules build successfully before pushing and I would like to tap into that.</p>

<p>So does anybody know what the best way is to plug <code>docker push</code> into the <code>artifactoryPublish</code> task that comes with the Gradle Artifactory Plugin?</p>