dockerartifactorydocker-registry

Artifactory Docker Login to Repository Localhost


I have a local Jfrog Artifactory Pro.

I use "http://localhost:8081/artifactory/webapp/#/home" to go to my Artifactory.

I created local Docker registry:

enter image description here

enter image description here

I configured a direct reverse proxy, from Rest API:

$ curl -u admin:xxxxxx-i "http://127.0.0.1:8081/artifactory/api/system/configuration/webServer"

HTTP/1.1 200 OK
Server: Artifactory/6.2.0
X-Artifactory-Id: de89ec654198c960:3f9aa2d0:167a7c20d5e:-8000
Access-Control-Allow-Methods: GET, POST, DELETE, PUT
Access-Control-Allow-Headers: X-Requested-With, Content-Type, X-Codingpedia
Cache-Control: no-store
Content-Type: application/json
Transfer-Encoding: chunked
Date: Sun, 16 Dec 2018 13:04:52 GMT

{
  "key" : "direct",
  "webServerType" : "DIRECT",
  "artifactoryAppContext" : "artifactory",
  "publicAppContext" : "artifactory",
  "serverName" : "127.0.0.1",
  "serverNameExpression" : "*.localhost",
  "artifactoryServerName" : "localhost",
  "artifactoryPort" : 8081,
  "dockerReverseProxyMethod" : "SUBDOMAIN",
  "useHttps" : false,
  "useHttp" : true,
  "httpsPort" : 443,
  "httpPort" : 8081,
  "upStreamName" : "artifactory"
}

Configuration from artifactory:

enter image description here

I want to login to my registry "mylocaldocker" via docker client but I get an error:

$ docker login mylocaldocker.localhost -u admin -p xxxxxx
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Error response from daemon: Get https://mylocaldocker.localhost/v2/: dial tcp: lookup mylocaldocker.localhost on 192.168.65.1:53: no such host

How can I log in to artifactory docker registry? and pull/push images to it!?


Solution

  • First: docker login related to Artifactory -> Configurations -> HTTP Settings I used "Docker access method" as "Repository path"

    docker login -u admin -p **** x.x.x.x:8081

    Second: Due to a limitation in docker, we cannot use login to localhost. we should replace "localhost" or "127.0.0.1" by real machine IP (private IP).

    And add private_ip:8081 (x.x.x.x:8081) to insecure registries in docker. See the answer in this link: Pull Artifactory Docker Images