Just created a self-hosted Artifactory running on AWS. I can reach the Artifactory UI at 10.100.10.100:8082 (not the real address). I setup a Docker repo, and the URL showing in the UI for the repo is http://10.100.10.100:8082/artifactory/myrepo/. The Docker login command was successful, but the Docker push won't work. I tried tagging the image as 10.100.10.100:8082/artifactory/myrepo, but after retrying several times, I get unknown: not found
. I tried tagging with the entire URl including the http://
but it won't accept that as a tag name. What is the proper syntax for pushing a tagged image to my self-hosted Artifactory?
CodePudding user response:
By default, Artifactory as Docker registry is configured with Repository path method. which means, that for pulling and pushing docker images, you will need to append the url with repository key and image name and tag.
For example:
Assuming the docker image is alpine and the tag is latest. The Artifactory docker repository is of type local and the repository key is docker-local.
Back to the example above,
docker login 10.100.10.100:8081
docker tag <alpine:latest-image_id> 10.100.10.100:8081/docker-local/alpine:latest
docker push 10.100.10.100:8081/docker-local/alpine:latest
docker pull 10.100.10.100:8081/docker-local/alpine
A few side notes:
In version 7.x the web UI is accessible via port 8082 and Artifactory’s service is still using port 8081
You might need to add the ip address:port of the running Artifactory to the docker daemon configuration file. As follows:
insecure-registries": [ "10.100.10.100:8081" ]
For further read regarding Repository Path Method please refer to: https://www.jfrog.com/confluence/display/JFROG/Getting Started with Artifactory as a Docker Registry#GettingStartedwithArtifactoryasaDockerRegistry-TheRepositoryPathMethod