1

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!?

6
  • is mylocaldocker.localhost correct hostname for the docker service? Did you configured docker service to listen to the different hostnames rather that 127.0.0.1 ?
    – Ji Ra
    Dec 16, 2018 at 13:25
  • I added environment variable "DOCKER_OPTS" with Value "--insecure-registry mylocaldocker.localhost ".
    – Sherein
    Dec 16, 2018 at 13:40
  • is docker hosted on local machine?
    – Ji Ra
    Dec 16, 2018 at 13:42
  • I have windows environment. docker is installed on my local machine.
    – Sherein
    Dec 16, 2018 at 13:45
  • Am I writing the login command right? Should I change "mylocaldocker.localhost" to something else?
    – Sherein
    Dec 16, 2018 at 14:38

1 Answer 1

2

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.