title: Cannot push to remote repo using the (spotify) Docker maven plugin
body: <p>I've got a Spring Boot project which I want to built an image from and push to a Docker private registry. I've followed <a href="https://spring.io/guides/gs/spring-boot-docker/" rel="nofollow">Spring Boot official docs</a> for that, using the <a href="https://github.com/spotify/docker-maven-plugin" rel="nofollow">Spotify Docker Maven plugin</a>. That worked well when publishing my image to a docker local instance using Boot2Docker.</p>
  
  <p>Now I'm trying to do the same with a remote private repo (an unsecured one) and I'm struggling with it. I've followed the plugin documentation for that and that's how my configuration looks like:</p>
  
  <pre><code>&lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;com.spotify&lt;/groupId&gt;
              &lt;artifactId&gt;docker-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;0.4.9&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;imageName&gt;service-discovery&lt;/imageName&gt;
                  &lt;dockerDirectory&gt;src/main/docker&lt;/dockerDirectory&gt;
                  &lt;resources&gt;
                      &lt;resource&gt;
                          &lt;targetPath&gt;/&lt;/targetPath&gt;
                          &lt;directory&gt;${project.build.directory}&lt;/directory&gt;
                          &lt;include&gt;${project.build.finalName}.war&lt;/include&gt;
                      &lt;/resource&gt;
                  &lt;/resources&gt;
              &lt;/configuration&gt;
                &lt;executions&gt;
                  &lt;execution&gt;
                    &lt;id&gt;build-image&lt;/id&gt;
                    &lt;phase&gt;package&lt;/phase&gt;
                    &lt;goals&gt;
                      &lt;goal&gt;build&lt;/goal&gt;
                    &lt;/goals&gt;
                  &lt;/execution&gt;
                  &lt;execution&gt;
                    &lt;id&gt;tag-image&lt;/id&gt;
                    &lt;phase&gt;package&lt;/phase&gt;
                    &lt;goals&gt;
                      &lt;goal&gt;tag&lt;/goal&gt;
                    &lt;/goals&gt;
                    &lt;configuration&gt;
                      &lt;image&gt;service-discovery&lt;/image&gt;
                      &lt;newName&gt;develop01.mycompany.com:5000/service-discovery&lt;/newName&gt;
                    &lt;/configuration&gt;
                  &lt;/execution&gt;
                &lt;/executions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>My registry is accessible through <code>http://develop01.mycompany.com:5000</code>, but the docker plugin seems not to be able to find it.</p>
  
  <p>Executing <em>mvn clean install</em> throws:</p>
  
  <blockquote>
    <p>[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:0.4.9:build (buil
    d-image) on project service-discovery: Exception caught: java.util.concurrent.Ex
    ecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingExcepti
    on: org.apache.http.conn.HttpHostConnectException: Connect to localhost:2375 [lo
    calhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connec
    t -> [Help 1]</p>
  </blockquote>
  
  <p>Executing <em>mvn docker:tag -DpushImage</em> throws:</p>
  
  <blockquote>
    <p>[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:0.4.9:tag (defaul
    t-cli) on project service-discovery: The parameters 'image', 'newName' for goal
    com.spotify:docker-maven-plugin:0.4.9:tag are missing or invalid -> [Help 1]</p>
  </blockquote>
  
  <p>So the plugin seems not to recognize the parameters into the image goal (in fact, it looks like it's trying to connect to a local Docker instance when executing <em>mvn clean install</em>).</p>
  
  <p><strong>Software:</strong></p>
  
  <ul>
  <li>docker version: Server: 1.11.0</li>
  <li>docker-maven-plugin version: 0.4.9</li>
  <li>maven version: 3.2.3</li>
  </ul>
  
  <p>A link to the <a href="https://github.com/spotify/docker-maven-plugin/issues/227" rel="nofollow">GitHub issue</a> I created</p>
  
  <hr>
  
  <p><strong>Update</strong></p>
  
  <p>I have set my DOCKER_HOST environment variable to <code>tcp://develop01.mycompany.com:5000</code> and now the plugin seems to pick it. Still don't understand why I have to do it through an environment variable, when I'm declaring the server name in the execution configuration. All in all, that's the error I'm getting right now:</p>
  
  <blockquote>
    <p>[ERROR] Failed to execute goal
    com.spotify:docker-maven-plugin:0.4.9:build (buil d-image) on project
    service-discovery: Exception caught: Request error: GET http
    ://develop01.mycompany.com:5000/version: 404: HTTP 404 Not Found ->
    [Help 1]</p>
  </blockquote>
  
  <p>In fact, the /version endpoint of my registry returns 404. The /v2 endpoint however, returns an empty JSON. Is the plugin trying to deal with a previous docker version API?</p>