1

I am trying to push the image using fabric8 docker-maven-plugin

Here is the relevant part of the plugin configuration

<build>
  <plugins>
    <plugin>
      <groupId>io.fabric8</groupId>
      <artifactId>docker-maven-plugin</artifactId>
      <configuration>
        <pushRegistry>http://registry.my.com:5000</pushRegistry>
        <images>
          <image>
            <name>test_repo:push-test-admin</name>
            <build>
              <contextDir>${project.basedir}/src/main/docker</contextDir>
            </build>
          </image>
        </images>
      </configuration>
    </plugin>
  </plugins>
</build>

I am trying to push to an insecure private docker registry http://registry.my.com:5000 and get the following error

DOCKER> RESPONSE {"message":"no such image: **http:/registry.my.com:5000/test_repo:push-test-admin**: invalid reference format"}

Notice the http:/registry and not http://registry

Command used for pushing is mvn -X docker:push

Here are some relevant logs leading to the issue

DOCKER> REQUEST GET /v1.40/images/http%3A%2F%2Fregistry.my.com%3A5000%2Ftest_repo%3Apush-test-admin/json HTTP/1.1

[DEBUG] DOCKER> RESPONSE HTTP/1.1 301 Moved Permanently
Location: /v1.40/images/http:/registry.my.com:5000/test_repo:push-test-admin/json

[DEBUG] DOCKER> REQUEST GET /v1.40/images/http:/registry.my.com:5000/test_repo:push-test-admin/json HTTP/1.1

[DEBUG] DOCKER> RESPONSE HTTP/1.1 400 Bad Request
Api-Version: 1.40

[DEBUG] DOCKER> RESPONSE {"message":"no such image: **http:/registry.my.com:5000**/test_repo:push-test-admin: invalid reference format"}

[ERROR] DOCKER> Unable to check image [http://registry.my.com:5000/test_repo:push-test-admin] : {"message":"no such image: http:/registry.my.com:5000/test_repo:push-test-admin: invalid reference format"} (Bad Request: 400) [{"message":"no such image: http:/registry.my.com:5000/test_repo:push-test-admin: invalid reference format"} (Bad Request: 400)]

Am I doing something wrong in the configuration?

P.S. d-m-p version : 0.33.0

Maven version (mvn -v) : 3.6.2

Docker version : 19.03.8

Sniper
  • 1,428
  • 1
  • 12
  • 28
  • does it work if you add `--insecure-registry` to docker-dameon ? https://stackoverflow.com/a/36401701/2087704 – invad0r Apr 16 '20 at 10:54
  • @invad0r I have already added it to insecure-registry. Also I tried the same thing with and without adding insecure-registry to docker-daemon. Still the same error – Sniper Apr 16 '20 at 11:13

0 Answers0