Skip to content

Self-hosted renovate: authentication against private docker registry #839

Closed

Description

@sergeyscherba

Hi guys

I'm trying to configure self-hosted renovate to use Artifactory as docker registry with the followingsetup:

  • github enterprise server 3.12.1
  • enterprise-hosted artifactory 7.77.11

My current goal is to configure a test workflow just to see renovate working, even without any meaningful output.

My workflow:

  name: Test Renovate
  on:
    workflow_dispatch:
  jobs:
    test-renovate:
      runs-on: [self-hosted, vm-u20 ]
      steps:
      - uses: actions/checkout@v4

      - name: Self-hosted Renovate
        uses: myorg/my-test-repo/actions/renovate@main
        with:
          renovate-image: "renovatebot/renovate"
          renovate-version: "full"
          configurationFile: .github/renovate-global.js
        env:
          RENOVATE_ENDPOINT: "https://git.myenterprise.com/api/v3"
          LOG_LEVEL: 'debug'

My renovate-global.js:

module.exports = {
    branchPrefix: 'test-renovate/',
    username: 'myuser',
    gitAuthor: 'My User <myuser@myenterprise.com>',
    onboarding: true,
    platform: 'github',
    includeForks: true,
    dryRun: 'full',
    repositories: ['my-test-repo'],
    hostRules: [
        {
            matchHost: 'artifactory.myenterprise.com',
            hostType: 'artifactory',
            username: 'myuser',
            password: 'mytoken'
        }
    ]
  };

But it does look like renovate is even trying to authenticate against artifactory. It still tries to access dockerhub. according to this error message:

Unable to find image 'renovatebot/renovate:full' locally
docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": EOF.

Could someone advise what is wrong in my configuration? Thanks!

Activity

  1. rarkins commented on May 16, 2024

    @rarkins
    Contributor
    1. hostRules tell Renovate how to authenticate with a host. They do not tell Renovate when to use that host
    2. hostRules apply once Renovate is running. Your Renovate fails to even start, because it can't be pulled

    You probably need a fully qualified docker image such as "my.artifactory.host/docker/renovatebot/renovate". Right now you've told your action to use "renovatebot/renovate:full" and that's exactly what it's trying (from Docker Hub). And after that you might need to work out authentication, from the sounds of it. e.g. perhaps running a "docker login" prior

  2. sergeyscherba commented on May 16, 2024

    @sergeyscherba
    Author

    Thanks a lot, @rarkins, now downloads the image. Could I ask you to advise what do these error messages mean?:

    DEBUG: Unexpected Graph QL errors (repository=myreponame)
    "res": {
    "errors": [
    {
    "extensions": {
    "value": null,
    "problems": [
    {"path": [], "explanation": "Expected value to not be null"}
    ]
    },
    "locations": [{"line": 2, "column": 24}],
    "message": "Variable $name of type String! was provided invalid value"
    }
    ]
    }
    DEBUG: Caught initRepo error (repository=myreponame)
    "err": {
    "message": "platform-unknown-error",
    "stack": "Error: platform-unknown-error\n at Proxy.initRepo (/usr/local/renovate/lib/modules/platform/github/index.ts:512:13)\n at processTicksAndRejections (node:internal/process/task_queues:95:5)\n at getPlatformConfig (/usr/local/renovate/lib/workers/repository/init/apis.ts:97:26)\n at initApis (/usr/local/renovate/lib/workers/repository/init/apis.ts:109:12)\n at initRepo (/usr/local/renovate/lib/workers/repository/init/index.ts:53:12)\n at Object.renovateRepository (/usr/local/renovate/lib/workers/repository/index.ts:62:14)\n at attributes.repository (/usr/local/renovate/lib/workers/global/index.ts:217:11)\n at start (/usr/local/renovate/lib/workers/global/index.ts:202:7)\n at /usr/local/renovate/lib/renovate.ts:18:22"
    }

  3. rarkins commented on May 16, 2024

    @rarkins
    Contributor

    I'm not sure, please create a discussion with preserved formatting of logs into the main Renovate repo

  4. locked and limited conversation to collaborators on May 16, 2024
  5. converted this issue into a discussion #840 on May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Datasource

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions