diff --git a/lib/modules/datasource/docker/common.spec.ts b/lib/modules/datasource/docker/common.spec.ts
index 6880e87cd3088872a49ddee7b2f696f6482599be..8414323f5521b36fe0324064528d071fbe49e14e 100644
--- a/lib/modules/datasource/docker/common.spec.ts
+++ b/lib/modules/datasource/docker/common.spec.ts
@@ -19,14 +19,6 @@ const http = new Http(dockerDatasourceId);
 jest.mock('../../../util/host-rules');
 
 describe('modules/datasource/docker/common', () => {
-  beforeEach(() => {
-    hostRules.find.mockReturnValue({
-      username: 'some-username',
-      password: 'some-password',
-    });
-    hostRules.hosts.mockReturnValue([]);
-  });
-
   describe('getRegistryRepository', () => {
     it('handles local registries', () => {
       const res = getRegistryRepository(
@@ -71,9 +63,58 @@ describe('modules/datasource/docker/common', () => {
         registryHost: 'https://my.local.registry',
       });
     });
+
+    it('supports insecure registryUrls', () => {
+      hostRules.find.mockReturnValueOnce({ insecureRegistry: true });
+      const res = getRegistryRepository(
+        'prefix/image',
+        'my.local.registry/prefix'
+      );
+      expect(res).toStrictEqual({
+        dockerRepository: 'prefix/prefix/image',
+        registryHost: 'http://my.local.registry',
+      });
+    });
+
+    it.each([
+      {
+        name: 'strimzi-kafka-operator',
+        url: 'https://quay.io/strimzi-helm/',
+        res: {
+          dockerRepository: 'strimzi-helm/strimzi-kafka-operator',
+          registryHost: 'https://quay.io',
+        },
+      },
+      {
+        name: 'strimzi-kafka-operator',
+        url: 'https://docker.io/strimzi-helm/',
+        res: {
+          dockerRepository: 'strimzi-helm/strimzi-kafka-operator',
+          registryHost: 'https://index.docker.io',
+        },
+      },
+      {
+        name: 'nginx',
+        url: 'https://docker.io',
+        res: {
+          dockerRepository: 'library/nginx',
+          registryHost: 'https://index.docker.io',
+        },
+      },
+    ])('($name, $url)', ({ name, url, res }) => {
+      expect(getRegistryRepository(name, url)).toStrictEqual(res);
+    });
   });
 
   describe('getAuthHeaders', () => {
+    beforeEach(() => {
+      hostRules.find.mockReturnValue({
+        username: 'some-username',
+        password: 'some-password',
+      });
+      hostRules.hosts.mockReturnValue([]);
+    });
+
     it('throw page not found exception', async () => {
       httpMock
         .scope('https://my.local.registry')
diff --git a/lib/modules/datasource/docker/common.ts b/lib/modules/datasource/docker/common.ts
index 202680e29602639235d331d7af474b97100c8be6..a75788cdcae562c654b8fd9f2c263fbcf2a3d685 100644
--- a/lib/modules/datasource/docker/common.ts
+++ b/lib/modules/datasource/docker/common.ts
@@ -249,25 +249,31 @@ export function getRegistryRepository(
       };
     }
   }
-  let registryHost: string | undefined;
+  let registryHost = registryUrl;
   const split = packageName.split('/');
   if (split.length > 1 && (split[0].includes('.') || split[0].includes(':'))) {
     [registryHost] = split;
     split.shift();
   }
   let dockerRepository = split.join('/');
-  if (!registryHost) {
-    registryHost = registryUrl.replace(
-      'https://docker.io',
-      'https://index.docker.io'
-    );
-  }
-  if (registryHost === 'docker.io') {
-    registryHost = 'index.docker.io';
-  }
-  if (!regEx(/^https?:\/\//).exec(registryHost)) {
+
+  if (!regEx(/^https?:\/\//).test(registryHost)) {
     registryHost = `https://${registryHost}`;
   }
+
+  const { path, base } =
+    regEx(/^(?<base>https:\/\/[^/]+)\/(?<path>.+)$/).exec(registryHost)
+      ?.groups ?? {};
+  if (base && path) {
+    registryHost = base;
+    dockerRepository = `${trimTrailingSlash(path)}/${dockerRepository}`;
+  }
+
+  registryHost = registryHost.replace(
+    'https://docker.io',
+    'https://index.docker.io'
+  );
+
   const opts = hostRules.find({
     hostType: dockerDatasourceId,
     url: registryHost,
diff --git a/lib/modules/datasource/docker/index.spec.ts b/lib/modules/datasource/docker/index.spec.ts
index 6750649a9dfb599cd11d8defa3c3cf383f877f82..3cf817a3aa4f95bb4a86d80565aa9b7ea6a9252e 100644
--- a/lib/modules/datasource/docker/index.spec.ts
+++ b/lib/modules/datasource/docker/index.spec.ts
@@ -1140,6 +1140,31 @@ describe('modules/datasource/docker/index', () => {
       expect(res?.releases).toHaveLength(1);
     });
 
+    it('uses quay api 2', async () => {
+      const tags = [{ name: '5.0.12' }];
+      httpMock
+        .scope('https://quay.io')
+        .get(
+          '/api/v1/repository/bitnami/redis/tag/?limit=100&page=1&onlyActiveTags=true'
+        )
+        .reply(200, { tags, has_additional: true })
+        .get(
+          '/api/v1/repository/bitnami/redis/tag/?limit=100&page=2&onlyActiveTags=true'
+        )
+        .reply(200, { tags: [], has_additional: false })
+        .get('/v2/')
+        .reply(200, '', {})
+        .get('/v2/bitnami/redis/manifests/5.0.12')
+        .reply(200, '', {});
+      const config = {
+        datasource: DockerDatasource.id,
+        packageName: 'redis',
+        registryUrls: ['https://quay.io/bitnami'],
+      };
+      const res = await getPkgReleases(config);
+      expect(res?.releases).toHaveLength(1);
+    });
+
     it('uses quay api and test error', async () => {
       httpMock
         .scope('https://quay.io')