How to pull image from Docker Store from Kubernetes Pod

3/1/2018

After following the link below, I can successfully pull my private images in Docker Hub from my Pods: Pull from Private repo

However, attempting to pull a Docker Store image doesn't seem to work.

I am able to pull this store image locally on my deskop using docker pull store/oracle/database-instantclient:12.2.0.1 and the same credentials that have been stored in Kubernetes as a secret.

What is the correct way to pull a Docker Store image from Kubernetes Pods?

Working pod config for my private repo/image:

image: index.docker.io/<privaterepo>/<privateimage>

I have tried the following in my pod config, none work:

image: store/oracle/database-instantclient:12.2.0.1

image: oracle/database-instantclient:12.2.0.1

image: index.docker.io/oracle/database-instantclient:12.2.0.1

image: index.docker.io/store/oracle/database-instantclient:12.2.0.1

All of the above attempts return the same error (with different image paths):

Failed to pull image "store/oracle/database-instantclient:12.2.0.1": rpc error: code = Unknown desc = Error response from daemon: repository store/oracle/database-instantclient not found: does not exist or no pull access

-- DonBecker
docker
dockerhub
kubernetes

1 Answer

3/26/2018

I managed to run this in minikube by setting up a secret with my docker login:

kubectl create secret docker-registry dockerstore \
    --docker-server=index.docker.io/v1/ \
    --docker-username={docker store username} \
    --docker-password={docker store password} \
    --docker-email={your email}

Then kubectl create -f testreplicaset.yaml

on

#testreplicaset.yaml
apiVersion: apps/v1
kind: ReplicaSet
metadata:
  name: oracle-instantclient
  labels:
    app: oracle-instantclient
spec:
  replicas: 1
  selector:
    matchLabels:
      app: oracle-instantclient
  template:
    metadata:
      labels:
        app: oracle-instantclient 
    spec:
      containers:
      - name: oracle-instantclient-container
        image: store/oracle/database-instantclient:12.2.0.1
        env:
        ports:
      imagePullSecrets:
      - name: dockerstore

I can't tell exactly why it doesn't work for you, but it might give more clues if you ssh into your kubernetes node and try docker pull in there.

-- Alan Douglass
Source: StackOverflow