# Pulling multiple privates image in the same registry using image\_pull\_secrets

**URL:** <https://drone.discourse.group/t/pulling-multiple-privates-image-in-the-same-registry-using-image-pull-secrets/9279>\
**Category:** Drone Support\
**Created:** [November 14, 2019, 3:49am UTC](https://drone.discourse.group/t/pulling-multiple-privates-image-in-the-same-registry-using-image-pull-secrets/9279 "2019-11-14T03:49:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![odg0318](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/odg0318/32/4307_2.png) [@odg0318](https://drone.discourse.group/u/odg0318)\
**Post date:** [November 14, 2019, 3:49am UTC](https://drone.discourse.group/t/pulling-multiple-privates-image-in-the-same-registry-using-image-pull-secrets/9279/1 "2019-11-14T03:49:32Z")

</div>

Suppose that there is a private registry whose domain name is my-registry.private.  
And there are 3 projects in the registry; “library”, “dev”, “security”.

“library” project can be publicly accessed by anonymous.  
“dev” and “security” are totally separated to access, which means each project has each account to login.

And so I created two docker config files for “dev”, “security” referencing the following document, [https://docs.drone.io/pipeline/kubernetes/syntax/images/#pulling-private-images](https://docs.drone.io/pipeline/kubernetes/syntax/images/#pulling-private-images).

It seems like that the first docker credential in `image_pull_secrets` is used in the same repository according to the following code. Can I specify a docker credential to pull `image` in step?

> <https://github.com/drone-runners/drone-runner-docker/blob/master/engine/compiler/compiler.go#L369>

```auto
	for _, step := range spec.Steps {
	STEPS:
		for _, cred := range creds {
			if image.MatchHostname(step.Image, cred.Address) {
				step.Auth = &engine.Auth{
					Address: cred.Address,
					Username: cred.Username,
					Password: cred.Password,
				}
				break STEPS
			}
		}
	}

```

My .drone.yml file is in below.

drone.yml

```auto
---
kind: pipeline
type: docker
name: default

clone:
  disable: true

steps:
- name: clone
  image: drone/git

- name: code test
  image: my-registry.private/dev/golang
  commands:
  - go test

- name: security test
  image: my-registry.private/security/scan
  commands:
  - scan all

- name: build/push
  image: my-registry.private/library/drone-plugin-docker
  privileged: true
  settings:
    registry: my-registry.private
    username:
      from_secret: docker_username
    password:
      from_secret: docker_password
    repo: my-registry.private/dev/app
    tags: latest
    dockerfile: Dockerfile

image_pull_secrets:
- dockerconfig_security
- dockerconfig_dev

```
