diff --git a/lib/modules/datasource/docker/index.spec.ts b/lib/modules/datasource/docker/index.spec.ts index 58217519974e94de3dff16f7f369bf8fc298f220..6750649a9dfb599cd11d8defa3c3cf383f877f82 100644 --- a/lib/modules/datasource/docker/index.spec.ts +++ b/lib/modules/datasource/docker/index.spec.ts @@ -1086,11 +1086,7 @@ describe('modules/datasource/docker/index', () => { { link: `<${baseUrl}/library/node/tags/list?n=1&page=2>; rel="next", `, } - ) - .get('/') - .reply(200) - .get('/library/node/manifests/1.0.1') - .reply(200); + ); const config = { datasource: DockerDatasource.id, @@ -1563,11 +1559,7 @@ describe('modules/datasource/docker/index', () => { 'Bearer realm="https://auth.docker.io/token",service="registry.docker.io",scope="repository:library/node:pull"', }) .get('/library/node/tags/list?n=10000') - .reply(200, { tags }, {}) - .get('/') - .reply(200) - .get('/library/node/manifests/1.0.0') - .reply(200); + .reply(200, { tags }, {}); httpMock .scope(authUrl) .get( @@ -1606,12 +1598,6 @@ describe('modules/datasource/docker/index', () => { }, ], }); - httpMock - .scope(baseUrl) - .get('/') - .reply(200) - .get('/library/node/manifests/1.0.0') - .reply(200); const res = await getPkgReleases({ datasource: DockerDatasource.id, packageName: 'docker.io/node', diff --git a/lib/modules/datasource/docker/index.ts b/lib/modules/datasource/docker/index.ts index 4b6a856ce3b61c4e0251f3dbea38e7b2a70b57a8..df29be785e5cf64fa9559f07bd99f0b374e9bdb5 100644 --- a/lib/modules/datasource/docker/index.ts +++ b/lib/modules/datasource/docker/index.ts @@ -431,7 +431,7 @@ export class DockerDatasource extends Datasource { namespace: 'datasource-docker-labels', key: (registryHost: string, dockerRepository: string, tag: string) => `${registryHost}:${dockerRepository}:${tag}`, - ttlMinutes: 60, + ttlMinutes: 24 * 60, }) public async getLabels( registryHost: string, @@ -439,6 +439,14 @@ export class DockerDatasource extends Datasource { tag: string ): Promise<Record<string, string> | undefined> { logger.debug(`getLabels(${registryHost}, ${dockerRepository}, ${tag})`); + // Docker Hub library images don't have labels we need + if ( + registryHost === 'https://index.docker.io' && + dockerRepository.startsWith('library/') + ) { + logger.debug('Docker Hub library image - skipping label lookup'); + return {}; + } try { let labels: Record<string, string> | undefined = {}; const manifest = await this.getManifest(