Custom Docker Repository URL for Artifactory and Jenkins

I’m trying to get the Docker Build and Publish plugin working on our Jenkins instance. The Docker image is getting built correctly, but I’m having issues with getting this image pushed to our Artifactory Docker Repository.

The Artifactory repository is hosted at https://instance.company.com/artifactory/test-docker-build

  • AWS ECS for Glassfish HA architecture
  • Need to move docker from one mac to another mac
  • Bitnami and Docker
  • Clear all entries in Docker mongodb?
  • Simple docker command does not work: x509: cannot validate certificate
  • Docker service failed to build : return a non-zero code 1
  • When I look in the logs for the build, it fails to upload the Docker image, but the url looks like https://instance.company.com/test-docker-build. Here is the output from the log:

    [workspace] $ docker push instance.company.com/test-docker-build:test
    The push refers to a repository [instance.company.com/test-docker-build] (len: 1)
    Sending image list
    Error: Status 405 trying to push repository test-docker-build: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>405 Method Not Allowed</title>\n</head><body>\n<h1>Method Not Allowed</h1>\n<p>The requested method PUT is not allowed for the URL /v1/repositories/test-docker-build/.</p>\n</body></html>\n"
    Build step 'Docker Build and Publish' marked build as failure
    Finished: FAILURE
    

    I am assuming that it is failing because the repository URL is incorrect. I have also tried logging into the backend and pushing via the command line with the correct repository URL and that doesn’t seem to work either.

    My main question is: does docker not like the URL structure since it uses the ‘/’ to denote user/image name? I.E. would this work if the url didn’t include the /artifactory?

    Any ideas would be greatly appreciated!

  • Image Search Docker Private Registry 2
  • Permission denied when pulling Docker image from Google Cloud Container Registry
  • docker-compose not working
  • This site can't be reached docs/docker.github.io
  • Docker container nodejs connection to external mysql fail
  • Azk with phpmyadmin
  • One Solution collect form web for “Custom Docker Repository URL for Artifactory and Jenkins”

    The response you’re getting back looks like something a reverse proxy would return (nginx\apache), not Artifactory – did you follow the instructions on how to set up a Reverse Proxy with Artifactory?

    Usually you would need to:

    • set up the reverse proxy for docker usage correctly
    • either get a certificate for company.com and use it in the proxy or set up Artifactory as an insecure registry (beware of this – should not be used in production)

    Once you did these you will reference the Artifactory instance as instance.company.com no need for /artifactory or anything else.
    The url you posted is what the reverse proxy should use when directing to Artifactory (i.e. instance.company.com/artifactory/api/docker/test-docker-build/v2)

    Then usage would look like docker push instance.company.com/myImage:myTag

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.