Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: replace dockerImagePrefix with dockerSidecarImage #22708

Merged
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/usage/self-hosted-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,17 +328,17 @@ For example, if you set `dockerChildPrefix=myprefix_` then the final container c
!!! note
Dangling containers are only removed when Renovate runs again with the same prefix.

## dockerImagePrefix
## dockerSidecarImage

By default Renovate pulls the sidecar Docker containers from `docker.io/containerbase`.
You can use the `dockerImagePrefix` option to override this default.
By default Renovate pulls the sidecar Docker containers from `ghcr.io/containerbase/sidecar`.
You can use the `dockerSidecarImage` option to override this default.

Say you want to pull your images from `ghcr.io/containerbase` to bypass Docker Hub limits.
Say you want to pull a custom image from `ghcr.io/your_company/sidecar`.
You would put this in your configuration file:

```json
{
"dockerImagePrefix": "ghcr.io/containerbase"
"dockerSidecarImage": "ghcr.io/your_company/sidecar"
}
```

Expand Down
2 changes: 1 addition & 1 deletion lib/config/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class GlobalConfig {
'containerbaseDir',
'customEnvVariables',
'dockerChildPrefix',
'dockerImagePrefix',
'dockerSidecarImage',
'dockerUser',
'dryRun',
'exposeAllEnv',
Expand Down
6 changes: 3 additions & 3 deletions lib/config/options/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,11 @@ const options: RenovateOptions[] = [
default: 'renovate_',
},
{
name: 'dockerImagePrefix',
name: 'dockerSidecarImage',
description:
'Change this value to override the default Renovate Docker sidecar image name prefix.',
'Change this value to override the default Renovate sidecar image.',
type: 'string',
default: 'docker.io/containerbase',
default: 'ghcr.io/containerbase/sidecar:8.0.2',
globalOnly: true,
},
{
Expand Down
2 changes: 1 addition & 1 deletion lib/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export interface RepoGlobalConfig {
cacheHardTtlMinutes?: number;
customEnvVariables?: Record<string, string>;
dockerChildPrefix?: string;
dockerImagePrefix?: string;
dockerSidecarImage?: string;
dockerUser?: string;
dryRun?: DryRunConfig;
executionTimeout?: number;
Expand Down
29 changes: 15 additions & 14 deletions lib/modules/manager/bundler/artifacts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const adminConfig: RepoGlobalConfig = {
localDir: join('/tmp/github/some/repo'),
cacheDir: join('/tmp/cache'),
containerbaseDir: join('/tmp/cache/containerbase'),
dockerSidecarImage: 'ghcr.io/containerbase/sidecar:8.0.2',
RahulGautamSingh marked this conversation as resolved.
Show resolved Hide resolved
};

const config: UpdateArtifactsConfig = {};
Expand Down Expand Up @@ -279,7 +280,7 @@ describe('modules/manager/bundler/artifacts', () => {
})
).toEqual([updatedGemfileLock]);
expect(execSnapshots).toMatchObject([
{ cmd: 'docker pull containerbase/sidecar' },
{ cmd: 'docker pull ghcr.io/containerbase/sidecar:8.0.2' },
{ cmd: 'docker ps --filter name=renovate_sidecar -aq' },
{
cmd:
Expand All @@ -290,7 +291,7 @@ describe('modules/manager/bundler/artifacts', () => {
'-e BUILDPACK_CACHE_DIR ' +
'-e CONTAINERBASE_CACHE_DIR ' +
'-w "/tmp/github/some/repo" ' +
'containerbase/sidecar' +
'ghcr.io/containerbase/sidecar:8.0.2' +
' bash -l -c "' +
'install-tool ruby 1.2.0' +
' && ' +
Expand Down Expand Up @@ -339,7 +340,7 @@ describe('modules/manager/bundler/artifacts', () => {
})
).toEqual([updatedGemfileLock]);
expect(execSnapshots).toMatchObject([
{ cmd: 'docker pull containerbase/sidecar' },
{ cmd: 'docker pull ghcr.io/containerbase/sidecar:8.0.2' },
{ cmd: 'docker ps --filter name=renovate_sidecar -aq' },
{
cmd:
Expand All @@ -350,7 +351,7 @@ describe('modules/manager/bundler/artifacts', () => {
'-e BUILDPACK_CACHE_DIR ' +
'-e CONTAINERBASE_CACHE_DIR ' +
'-w "/tmp/github/some/repo" ' +
'containerbase/sidecar' +
'ghcr.io/containerbase/sidecar:8.0.2' +
' bash -l -c "' +
'install-tool ruby 1.2.5' +
' && ' +
Expand Down Expand Up @@ -401,7 +402,7 @@ describe('modules/manager/bundler/artifacts', () => {
})
).toEqual([updatedGemfileLock]);
expect(execSnapshots).toMatchObject([
{ cmd: 'docker pull containerbase/sidecar' },
{ cmd: 'docker pull ghcr.io/containerbase/sidecar:8.0.2' },
{ cmd: 'docker ps --filter name=renovate_sidecar -aq' },
{
cmd:
Expand All @@ -412,7 +413,7 @@ describe('modules/manager/bundler/artifacts', () => {
'-e BUILDPACK_CACHE_DIR ' +
'-e CONTAINERBASE_CACHE_DIR ' +
'-w "/tmp/github/some/repo" ' +
'containerbase/sidecar' +
'ghcr.io/containerbase/sidecar:8.0.2' +
' bash -l -c "' +
'install-tool ruby 1.3.0' +
' && ' +
Expand Down Expand Up @@ -462,7 +463,7 @@ describe('modules/manager/bundler/artifacts', () => {
})
).toEqual([updatedGemfileLock]);
expect(execSnapshots).toMatchObject([
{ cmd: 'docker pull containerbase/sidecar' },
{ cmd: 'docker pull ghcr.io/containerbase/sidecar:8.0.2' },
{ cmd: 'docker ps --filter name=renovate_sidecar -aq' },
{
cmd:
Expand All @@ -474,7 +475,7 @@ describe('modules/manager/bundler/artifacts', () => {
'-e BUILDPACK_CACHE_DIR ' +
'-e CONTAINERBASE_CACHE_DIR ' +
'-w "/tmp/github/some/repo" ' +
'containerbase/sidecar' +
'ghcr.io/containerbase/sidecar:8.0.2' +
' bash -l -c "' +
'install-tool ruby 1.2.0' +
' && ' +
Expand Down Expand Up @@ -533,7 +534,7 @@ describe('modules/manager/bundler/artifacts', () => {
})
).toEqual([updatedGemfileLock]);
expect(execSnapshots).toMatchObject([
{ cmd: 'docker pull containerbase/sidecar' },
{ cmd: 'docker pull ghcr.io/containerbase/sidecar:8.0.2' },
{ cmd: 'docker ps --filter name=renovate_sidecar -aq' },
{
cmd:
Expand All @@ -544,7 +545,7 @@ describe('modules/manager/bundler/artifacts', () => {
'-e BUILDPACK_CACHE_DIR ' +
'-e CONTAINERBASE_CACHE_DIR ' +
'-w "/tmp/github/some/repo" ' +
'containerbase/sidecar' +
'ghcr.io/containerbase/sidecar:8.0.2' +
' bash -l -c "' +
'install-tool ruby 1.2.0' +
' && ' +
Expand Down Expand Up @@ -605,7 +606,7 @@ describe('modules/manager/bundler/artifacts', () => {
})
).toEqual([updatedGemfileLock]);
expect(execSnapshots).toMatchObject([
{ cmd: 'docker pull containerbase/sidecar' },
{ cmd: 'docker pull ghcr.io/containerbase/sidecar:8.0.2' },
{ cmd: 'docker ps --filter name=renovate_sidecar -aq' },
{
cmd:
Expand All @@ -616,7 +617,7 @@ describe('modules/manager/bundler/artifacts', () => {
'-e BUILDPACK_CACHE_DIR ' +
'-e CONTAINERBASE_CACHE_DIR ' +
'-w "/tmp/github/some/repo" ' +
'containerbase/sidecar' +
'ghcr.io/containerbase/sidecar:8.0.2' +
' bash -l -c "' +
'install-tool ruby 1.2.0' +
' && ' +
Expand Down Expand Up @@ -676,7 +677,7 @@ describe('modules/manager/bundler/artifacts', () => {
})
).toEqual([updatedGemfileLock]);
expect(execSnapshots).toMatchObject([
{ cmd: 'docker pull containerbase/sidecar' },
{ cmd: 'docker pull ghcr.io/containerbase/sidecar:8.0.2' },
{ cmd: 'docker ps --filter name=renovate_sidecar -aq' },
{
cmd:
Expand All @@ -687,7 +688,7 @@ describe('modules/manager/bundler/artifacts', () => {
'-e BUILDPACK_CACHE_DIR ' +
'-e CONTAINERBASE_CACHE_DIR ' +
'-w "/tmp/github/some/repo" ' +
'containerbase/sidecar' +
'ghcr.io/containerbase/sidecar:8.0.2' +
' bash -l -c "' +
'install-tool ruby 1.2.0' +
' && ' +
Expand Down
5 changes: 3 additions & 2 deletions lib/modules/manager/cargo/artifacts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const adminConfig: RepoGlobalConfig = {
localDir: join('/tmp/github/some/repo'),
cacheDir: join('/tmp/cache'),
containerbaseDir: join('/tmp/cache/containerbase'),
dockerSidecarImage: 'ghcr.io/containerbase/sidecar:8.0.2',
};

describe('modules/manager/cargo/artifacts', () => {
Expand Down Expand Up @@ -210,7 +211,7 @@ describe('modules/manager/cargo/artifacts', () => {
},
]);
expect(execSnapshots).toMatchObject([
{ cmd: 'docker pull containerbase/sidecar' },
{ cmd: 'docker pull ghcr.io/containerbase/sidecar:8.0.2' },
{},
{
cmd:
Expand All @@ -220,7 +221,7 @@ describe('modules/manager/cargo/artifacts', () => {
'-e BUILDPACK_CACHE_DIR ' +
'-e CONTAINERBASE_CACHE_DIR ' +
'-w "/tmp/github/some/repo" ' +
'containerbase/sidecar ' +
'ghcr.io/containerbase/sidecar:8.0.2 ' +
'bash -l -c "' +
'install-tool rust 1.65.0' +
' && ' +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ exports[`modules/manager/cocoapods/artifacts returns pod exec error 1`] = `
exports[`modules/manager/cocoapods/artifacts returns updated Podfile 1`] = `
[
{
"cmd": "docker pull containerbase/sidecar",
"cmd": "docker pull ghcr.io/containerbase/sidecar:8.0.2",
"options": {
"encoding": "utf-8",
},
},
{
"cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" containerbase/sidecar bash -l -c "install-tool ruby 3.1.0 && install-tool cocoapods 3.1.0 && gem install cocoapods-acknowledgements && pod install"",
"cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" ghcr.io/containerbase/sidecar:8.0.2 bash -l -c "install-tool ruby 3.1.0 && install-tool cocoapods 3.1.0 && gem install cocoapods-acknowledgements && pod install"",
"options": {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand All @@ -88,13 +88,13 @@ exports[`modules/manager/cocoapods/artifacts returns updated Podfile 1`] = `
exports[`modules/manager/cocoapods/artifacts returns updated Podfile and Pods files 1`] = `
[
{
"cmd": "docker pull containerbase/sidecar",
"cmd": "docker pull ghcr.io/containerbase/sidecar:8.0.2",
"options": {
"encoding": "utf-8",
},
},
{
"cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" containerbase/sidecar bash -l -c "install-tool ruby 3.1.0 && install-tool cocoapods 3.1.0 && pod install"",
"cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" ghcr.io/containerbase/sidecar:8.0.2 bash -l -c "install-tool ruby 3.1.0 && install-tool cocoapods 3.1.0 && pod install"",
"options": {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand Down
5 changes: 3 additions & 2 deletions lib/modules/manager/cocoapods/artifacts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const adminConfig: RepoGlobalConfig = {
localDir: join('/tmp/github/some/repo'),
cacheDir: join('/tmp/cache'),
containerbaseDir: join('/tmp/cache/containerbase'),
dockerSidecarImage: 'ghcr.io/containerbase/sidecar:8.0.2',
};

describe('modules/manager/cocoapods/artifacts', () => {
Expand Down Expand Up @@ -252,7 +253,7 @@ describe('modules/manager/cocoapods/artifacts', () => {
config,
});
expect(execSnapshots).toMatchObject([
{ cmd: 'docker pull containerbase/sidecar' },
{ cmd: 'docker pull ghcr.io/containerbase/sidecar:8.0.2' },
{
cmd:
'docker run --rm --name=renovate_sidecar --label=renovate_child ' +
Expand All @@ -261,7 +262,7 @@ describe('modules/manager/cocoapods/artifacts', () => {
'-e BUILDPACK_CACHE_DIR ' +
'-e CONTAINERBASE_CACHE_DIR ' +
'-w "/tmp/github/some/repo" ' +
'containerbase/sidecar' +
'ghcr.io/containerbase/sidecar:8.0.2' +
' bash -l -c "' +
'install-tool ruby 3.1.0' +
' && ' +
Expand Down
5 changes: 3 additions & 2 deletions lib/modules/manager/composer/artifacts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const adminConfig: RepoGlobalConfig = {
localDir: join('/tmp/github/some/repo'),
cacheDir: join('/tmp/renovate/cache'),
containerbaseDir: join('/tmp/renovate/cache/containerbase'),
dockerSidecarImage: 'ghcr.io/containerbase/sidecar:8.0.2',
};

const repoStatus = partial<StatusResult>({
Expand Down Expand Up @@ -784,7 +785,7 @@ describe('modules/manager/composer/artifacts', () => {
]);
expect(execSnapshots).toMatchObject([
{
cmd: 'docker pull containerbase/sidecar',
cmd: 'docker pull ghcr.io/containerbase/sidecar:8.0.2',
options: {
encoding: 'utf-8',
},
Expand All @@ -804,7 +805,7 @@ describe('modules/manager/composer/artifacts', () => {
'-e BUILDPACK_CACHE_DIR ' +
'-e CONTAINERBASE_CACHE_DIR ' +
'-w "/tmp/github/some/repo" ' +
'containerbase/sidecar' +
'ghcr.io/containerbase/sidecar:8.0.2' +
' bash -l -c "' +
'install-tool php 7.3' +
' && ' +
Expand Down
Loading