[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: How to import private image from hub.docker to ImageStream ?





On 02/23/2016 01:56 PM, Stéphane Klein wrote:
I've tried to append :

```
# oc secrets add serviceaccount/default secrets/hub.docker.io --pull
# oc secrets add serviceaccount/default secrets/hub.docker.io --for=pull
# oc secrets add serviceaccount/default secrets/hub.docker.io
# oc secrets add serviceaccount/deployer secrets/hub.docker.io
```

I've always :

```
# oc import-image api
The import completed successfully.

Name:            api
Created:        3 hours ago
Labels:            <none>
Annotations:
openshift.io/image.dockerRepositoryCheck=2016-02-23T09:14:34Z
Docker Pull Spec:    172.30.27.206:5000/foobar/api

Tag    Spec    Created        PullSpec    Image
latest    api    3 hours ago            import failed: you may not have
access to the Docker image "api"
```

Best regards,
Stéphane

2016-02-23 12:48 GMT+01:00 Stéphane Klein <contact stephane-klein info>:

2016-02-23 11:05 GMT+01:00 Maciej Szulik <maszulik redhat com>:

Have you checked this doc:


https://docs.openshift.org/latest/architecture/core_concepts/builds_and_image_streams.html#private-registries



Thanks for this url :)

I've created my hub.docker.io secret with (I have replaced with my
credentials) :

```
oc secrets new-dockercfg SECRET --docker-server=DOCKER_REGISTRY_SERVER
--docker-username=DOCKER_USER --docker-password=DOCKER_PASSWORD
--docker-email=DOCKER_EMAIL
```

Now I've :

```
# oc get secret hub.docker.io -o json
{
     "kind": "Secret",
     "apiVersion": "v1",
     "metadata": {
         "name": "hub.docker.io",
         "namespace": "foobar-staging",
         "selfLink": "/api/v1/namespaces/foobar-staging/secrets/
hub.docker.io",
         "uid": "3b1b2aa4-da15-11e5-b613-080027143490",
         "resourceVersion": "19813",
         "creationTimestamp": "2016-02-23T10:07:22Z"
     },
     "data": {
         ".dockercfg": ".................................."
     },
     "type": "kubernetes.io/dockercfg"
}
```

When I execute :

```
# oc import-image api
The import completed successfully.

Name:            api
Created:        2 hours ago
Labels:            <none>
Annotations:
openshift.io/image.dockerRepositoryCheck=2016-02-23T09:14:34Z
Docker Pull Spec:    172.30.27.206:5000/foobar-staging/api

Tag    Spec    Created        PullSpec    Image
latest    api    2 hours ago            import failed: you may not have
access to the Docker image "api"
```

Where is my mistake ? how can I say to my ImageStream to use my
hub.docker.io secret ?


It looks like there's an error in the image-import command if the
first import failed, I've created an issue to address that:
https://github.com/openshift/origin/issues/7555

Current workaround is to re-create the image stream and import should
pick the proper secret. Btw. make sure the server is either:
auth.docker.io/token or index.docker.io/v1/ otherwise it won't match
the server. The former is new auth endpoint, the latter is old one.

Maciej


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]