From 95339bde33ef6538a5addc027a5a2959fcddb87f Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Wed, 28 Sep 2022 17:09:28 +0200
Subject: [PATCH] refactor: use containerbase terminology (#18023)

---
 lib/modules/manager/bundler/artifacts.spec.ts | 14 ++--
 .../__snapshots__/artifacts.spec.ts.snap      |  3 +-
 .../__snapshots__/artifacts.spec.ts.snap      | 12 ++-
 .../manager/cocoapods/artifacts.spec.ts       |  2 +
 .../manager/composer/artifacts.spec.ts        |  1 +
 lib/modules/manager/gomod/artifacts.spec.ts   |  6 +-
 .../manager/gradle-wrapper/artifacts.spec.ts  |  1 +
 .../__snapshots__/artifacts.spec.ts.snap      |  6 +-
 .../mix/__snapshots__/artifacts.spec.ts.snap  |  6 +-
 .../manager/npm/post-update/lerna.spec.ts     |  1 +
 .../manager/npm/post-update/npm.spec.ts       |  1 +
 .../manager/npm/post-update/pnpm.spec.ts      |  1 +
 .../manager/npm/post-update/yarn.spec.ts      |  2 +-
 .../__snapshots__/artifacts.spec.ts.snap      |  3 +-
 .../manager/pip-compile/artifacts.spec.ts     |  2 +
 .../pip_requirements/artifacts.spec.ts        |  1 +
 .../__snapshots__/artifacts.spec.ts.snap      | 12 ++-
 lib/modules/manager/poetry/artifacts.spec.ts  |  2 +
 lib/util/exec/containerbase.spec.ts           |  5 +-
 lib/util/exec/containerbase.ts                |  6 +-
 lib/util/exec/index.spec.ts                   | 78 ++++++++++---------
 lib/util/exec/index.ts                        |  4 +-
 22 files changed, 101 insertions(+), 68 deletions(-)

diff --git a/lib/modules/manager/bundler/artifacts.spec.ts b/lib/modules/manager/bundler/artifacts.spec.ts
index ae18b3c6b1..1e50bb4b73 100644
--- a/lib/modules/manager/bundler/artifacts.spec.ts
+++ b/lib/modules/manager/bundler/artifacts.spec.ts
@@ -208,7 +208,7 @@ describe('modules/manager/bundler/artifacts', () => {
         { cmd: 'docker pull renovate/ruby:1.2.0' },
         { cmd: 'docker ps --filter name=renovate_ruby -aq' },
         {
-          cmd: 'docker run --rm --name=renovate_ruby --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e GEM_HOME -e BUILDPACK_CACHE_DIR -w "/tmp/github/some/repo" renovate/ruby:1.2.0 bash -l -c "install-tool bundler 2.3.5 && ruby --version && bundler lock --update foo bar"',
+          cmd: 'docker run --rm --name=renovate_ruby --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e GEM_HOME -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" renovate/ruby:1.2.0 bash -l -c "install-tool bundler 2.3.5 && ruby --version && bundler lock --update foo bar"',
         },
       ]);
     });
@@ -249,7 +249,7 @@ describe('modules/manager/bundler/artifacts', () => {
         { cmd: 'docker pull renovate/ruby:latest' },
         { cmd: 'docker ps --filter name=renovate_ruby -aq' },
         {
-          cmd: 'docker run --rm --name=renovate_ruby --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e GEM_HOME -e BUILDPACK_CACHE_DIR -w "/tmp/github/some/repo" renovate/ruby:latest bash -l -c "install-tool bundler 3.2.1 && ruby --version && bundler lock --update foo bar"',
+          cmd: 'docker run --rm --name=renovate_ruby --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e GEM_HOME -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" renovate/ruby:latest bash -l -c "install-tool bundler 3.2.1 && ruby --version && bundler lock --update foo bar"',
         },
       ]);
     });
@@ -290,7 +290,7 @@ describe('modules/manager/bundler/artifacts', () => {
         { cmd: 'docker pull renovate/ruby:latest' },
         { cmd: 'docker ps --filter name=renovate_ruby -aq' },
         {
-          cmd: 'docker run --rm --name=renovate_ruby --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e GEM_HOME -e BUILDPACK_CACHE_DIR -w "/tmp/github/some/repo" renovate/ruby:latest bash -l -c "install-tool bundler 2.3.5 && ruby --version && bundler lock --update foo bar"',
+          cmd: 'docker run --rm --name=renovate_ruby --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e GEM_HOME -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" renovate/ruby:latest bash -l -c "install-tool bundler 2.3.5 && ruby --version && bundler lock --update foo bar"',
         },
       ]);
     });
@@ -338,7 +338,7 @@ describe('modules/manager/bundler/artifacts', () => {
         { cmd: 'docker pull renovate/ruby:1.2.0' },
         { cmd: 'docker ps --filter name=renovate_ruby -aq' },
         {
-          cmd: 'docker run --rm --name=renovate_ruby --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e BUNDLE_GEMS__PRIVATE__COM -e GEM_HOME -e BUILDPACK_CACHE_DIR -w "/tmp/github/some/repo" renovate/ruby:1.2.0 bash -l -c "install-tool bundler 2.3.5 && ruby --version && bundler lock --update foo bar"',
+          cmd: 'docker run --rm --name=renovate_ruby --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e BUNDLE_GEMS__PRIVATE__COM -e GEM_HOME -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" renovate/ruby:1.2.0 bash -l -c "install-tool bundler 2.3.5 && ruby --version && bundler lock --update foo bar"',
         },
       ]);
     });
@@ -388,7 +388,7 @@ describe('modules/manager/bundler/artifacts', () => {
         { cmd: 'docker pull renovate/ruby:1.2.0' },
         { cmd: 'docker ps --filter name=renovate_ruby -aq' },
         {
-          cmd: 'docker run --rm --name=renovate_ruby --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e GEM_HOME -e BUILDPACK_CACHE_DIR -w "/tmp/github/some/repo" renovate/ruby:1.2.0 bash -l -c "install-tool bundler 1.2 && ruby --version && bundler config --local gems-private.com some-user:some-password && bundler lock --update foo bar"',
+          cmd: 'docker run --rm --name=renovate_ruby --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e GEM_HOME -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" renovate/ruby:1.2.0 bash -l -c "install-tool bundler 1.2 && ruby --version && bundler config --local gems-private.com some-user:some-password && bundler lock --update foo bar"',
         },
       ]);
     });
@@ -438,7 +438,7 @@ describe('modules/manager/bundler/artifacts', () => {
         { cmd: 'docker pull renovate/ruby:1.2.0' },
         { cmd: 'docker ps --filter name=renovate_ruby -aq' },
         {
-          cmd: 'docker run --rm --name=renovate_ruby --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e GEM_HOME -e BUILDPACK_CACHE_DIR -w "/tmp/github/some/repo" renovate/ruby:1.2.0 bash -l -c "install-tool bundler 2.1 && ruby --version && bundler config set --local gems-private.com some-user:some-password && bundler lock --update foo bar"',
+          cmd: 'docker run --rm --name=renovate_ruby --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e GEM_HOME -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" renovate/ruby:1.2.0 bash -l -c "install-tool bundler 2.1 && ruby --version && bundler config set --local gems-private.com some-user:some-password && bundler lock --update foo bar"',
         },
       ]);
     });
@@ -486,7 +486,7 @@ describe('modules/manager/bundler/artifacts', () => {
         { cmd: 'docker pull renovate/ruby:1.2.0' },
         { cmd: 'docker ps --filter name=renovate_ruby -aq' },
         {
-          cmd: 'docker run --rm --name=renovate_ruby --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e GEM_HOME -e BUILDPACK_CACHE_DIR -w "/tmp/github/some/repo" renovate/ruby:1.2.0 bash -l -c "install-tool bundler 2.3.5 && ruby --version && bundler config set --local gems-private.com some-user:some-password && bundler lock --update foo bar"',
+          cmd: 'docker run --rm --name=renovate_ruby --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e GEM_HOME -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" renovate/ruby:1.2.0 bash -l -c "install-tool bundler 2.3.5 && ruby --version && bundler config set --local gems-private.com some-user:some-password && bundler lock --update foo bar"',
         },
       ]);
     });
diff --git a/lib/modules/manager/cargo/__snapshots__/artifacts.spec.ts.snap b/lib/modules/manager/cargo/__snapshots__/artifacts.spec.ts.snap
index 0e118b4b39..86ad6a9136 100644
--- a/lib/modules/manager/cargo/__snapshots__/artifacts.spec.ts.snap
+++ b/lib/modules/manager/cargo/__snapshots__/artifacts.spec.ts.snap
@@ -84,12 +84,13 @@ exports[`modules/manager/cargo/artifacts returns updated Cargo.lock with docker
     },
   },
   {
-    "cmd": "docker run --rm --name=renovate_rust --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e BUILDPACK_CACHE_DIR -w "/tmp/github/some/repo" renovate/rust bash -l -c "cargo update --manifest-path Cargo.toml --workspace"",
+    "cmd": "docker run --rm --name=renovate_rust --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" renovate/rust bash -l -c "cargo update --manifest-path Cargo.toml --workspace"",
     "options": {
       "cwd": "/tmp/github/some/repo",
       "encoding": "utf-8",
       "env": {
         "BUILDPACK_CACHE_DIR": "/tmp/cache/containerbase",
+        "CONTAINERBASE_CACHE_DIR": "/tmp/cache/containerbase",
         "HOME": "/home/user",
         "HTTPS_PROXY": "https://example.com",
         "HTTP_PROXY": "http://example.com",
diff --git a/lib/modules/manager/cocoapods/__snapshots__/artifacts.spec.ts.snap b/lib/modules/manager/cocoapods/__snapshots__/artifacts.spec.ts.snap
index a6d1f99da0..35b7e8c777 100644
--- a/lib/modules/manager/cocoapods/__snapshots__/artifacts.spec.ts.snap
+++ b/lib/modules/manager/cocoapods/__snapshots__/artifacts.spec.ts.snap
@@ -9,12 +9,13 @@ exports[`modules/manager/cocoapods/artifacts dynamically selects Docker image ta
     },
   },
   {
-    "cmd": "docker run --rm --name=renovate_ruby --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e BUILDPACK_CACHE_DIR -w "/tmp/github/some/repo" renovate/ruby:2.7.4 bash -l -c "install-tool cocoapods 1.2.4 && pod install"",
+    "cmd": "docker run --rm --name=renovate_ruby --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" renovate/ruby:2.7.4 bash -l -c "install-tool cocoapods 1.2.4 && pod install"",
     "options": {
       "cwd": "/tmp/github/some/repo",
       "encoding": "utf-8",
       "env": {
         "BUILDPACK_CACHE_DIR": "/tmp/cache/containerbase",
+        "CONTAINERBASE_CACHE_DIR": "/tmp/cache/containerbase",
         "HOME": "/home/user",
         "HTTPS_PROXY": "https://example.com",
         "HTTP_PROXY": "http://example.com",
@@ -39,12 +40,13 @@ exports[`modules/manager/cocoapods/artifacts falls back to the \`latest\` Docker
     },
   },
   {
-    "cmd": "docker run --rm --name=renovate_ruby --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e BUILDPACK_CACHE_DIR -w "/tmp/github/some/repo" renovate/ruby:latest bash -l -c "install-tool cocoapods 1.2.4 && pod install"",
+    "cmd": "docker run --rm --name=renovate_ruby --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" renovate/ruby:latest bash -l -c "install-tool cocoapods 1.2.4 && pod install"",
     "options": {
       "cwd": "/tmp/github/some/repo",
       "encoding": "utf-8",
       "env": {
         "BUILDPACK_CACHE_DIR": "/tmp/cache/containerbase",
+        "CONTAINERBASE_CACHE_DIR": "/tmp/cache/containerbase",
         "HOME": "/home/user",
         "HTTPS_PROXY": "https://example.com",
         "HTTP_PROXY": "http://example.com",
@@ -135,12 +137,13 @@ exports[`modules/manager/cocoapods/artifacts returns updated Podfile 2`] = `
     },
   },
   {
-    "cmd": "docker run --rm --name=renovate_ruby --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e BUILDPACK_CACHE_DIR -w "/tmp/github/some/repo" renovate/ruby:2.7.4 bash -l -c "install-tool cocoapods 3.1.0 && gem install cocoapods-acknowledgements && pod install"",
+    "cmd": "docker run --rm --name=renovate_ruby --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" renovate/ruby:2.7.4 bash -l -c "install-tool cocoapods 3.1.0 && gem install cocoapods-acknowledgements && pod install"",
     "options": {
       "cwd": "/tmp/github/some/repo",
       "encoding": "utf-8",
       "env": {
         "BUILDPACK_CACHE_DIR": "/tmp/cache/containerbase",
+        "CONTAINERBASE_CACHE_DIR": "/tmp/cache/containerbase",
         "HOME": "/home/user",
         "HTTPS_PROXY": "https://example.com",
         "HTTP_PROXY": "http://example.com",
@@ -197,12 +200,13 @@ exports[`modules/manager/cocoapods/artifacts returns updated Podfile and Pods fi
     },
   },
   {
-    "cmd": "docker run --rm --name=renovate_ruby --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/cache":"/tmp/cache" -e BUILDPACK_CACHE_DIR -w "/tmp/github/some/repo" renovate/ruby:2.7.4 bash -l -c "install-tool cocoapods 3.1.0 && pod install"",
+    "cmd": "docker run --rm --name=renovate_ruby --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" renovate/ruby:2.7.4 bash -l -c "install-tool cocoapods 3.1.0 && pod install"",
     "options": {
       "cwd": "/tmp/github/some/repo",
       "encoding": "utf-8",
       "env": {
         "BUILDPACK_CACHE_DIR": "/tmp/cache/containerbase",
+        "CONTAINERBASE_CACHE_DIR": "/tmp/cache/containerbase",
         "HOME": "/home/user",
         "HTTPS_PROXY": "https://example.com",
         "HTTP_PROXY": "http://example.com",
diff --git a/lib/modules/manager/cocoapods/artifacts.spec.ts b/lib/modules/manager/cocoapods/artifacts.spec.ts
index 7e5ac1b8b6..8a22855f5a 100644
--- a/lib/modules/manager/cocoapods/artifacts.spec.ts
+++ b/lib/modules/manager/cocoapods/artifacts.spec.ts
@@ -249,6 +249,7 @@ describe('modules/manager/cocoapods/artifacts', () => {
           '-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" ' +
           'renovate/ruby:2.7.4' +
           ' bash -l -c "' +
@@ -292,6 +293,7 @@ describe('modules/manager/cocoapods/artifacts', () => {
           '-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" ' +
           'renovate/ruby:latest' +
           ' bash -l -c "' +
diff --git a/lib/modules/manager/composer/artifacts.spec.ts b/lib/modules/manager/composer/artifacts.spec.ts
index 5626a65085..7778cbde9a 100644
--- a/lib/modules/manager/composer/artifacts.spec.ts
+++ b/lib/modules/manager/composer/artifacts.spec.ts
@@ -360,6 +360,7 @@ describe('modules/manager/composer/artifacts', () => {
           '-v "/tmp/renovate/cache":"/tmp/renovate/cache" ' +
           '-e COMPOSER_CACHE_DIR ' +
           '-e BUILDPACK_CACHE_DIR ' +
+          '-e CONTAINERBASE_CACHE_DIR ' +
           '-w "/tmp/github/some/repo" ' +
           'renovate/php:7.3' +
           ' bash -l -c "' +
diff --git a/lib/modules/manager/gomod/artifacts.spec.ts b/lib/modules/manager/gomod/artifacts.spec.ts
index 5279d6a930..5cf67b025c 100644
--- a/lib/modules/manager/gomod/artifacts.spec.ts
+++ b/lib/modules/manager/gomod/artifacts.spec.ts
@@ -299,6 +299,7 @@ describe('modules/manager/gomod/artifacts', () => {
           '-e GOFLAGS ' +
           '-e CGO_ENABLED ' +
           '-e BUILDPACK_CACHE_DIR ' +
+          '-e CONTAINERBASE_CACHE_DIR ' +
           '-w "/tmp/github/some/repo" ' +
           'renovate/go:latest' +
           ' bash -l -c "' +
@@ -453,6 +454,7 @@ describe('modules/manager/gomod/artifacts', () => {
           '-e GIT_CONFIG_KEY_5 ' +
           '-e GIT_CONFIG_VALUE_5 ' +
           '-e BUILDPACK_CACHE_DIR ' +
+          '-e CONTAINERBASE_CACHE_DIR ' +
           '-w "/tmp/github/some/repo" ' +
           'renovate/go:latest' +
           ' bash -l -c "' +
@@ -915,7 +917,7 @@ describe('modules/manager/gomod/artifacts', () => {
       { cmd: 'docker pull renovate/go:latest' },
       { cmd: 'docker ps --filter name=renovate_go -aq' },
       {
-        cmd: 'docker run --rm --name=renovate_go --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e GOPROXY -e GOPRIVATE -e GONOPROXY -e GONOSUMDB -e GOINSECURE -e GOFLAGS -e CGO_ENABLED -e BUILDPACK_CACHE_DIR -w "/tmp/github/some/repo" renovate/go:latest bash -l -c "go get -d -t ./... && go mod tidy && go mod tidy"',
+        cmd: 'docker run --rm --name=renovate_go --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e GOPROXY -e GOPRIVATE -e GONOPROXY -e GONOSUMDB -e GOINSECURE -e GOFLAGS -e CGO_ENABLED -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" renovate/go:latest bash -l -c "go get -d -t ./... && go mod tidy && go mod tidy"',
         options: { cwd: '/tmp/github/some/repo' },
       },
     ]);
@@ -952,7 +954,7 @@ describe('modules/manager/gomod/artifacts', () => {
       { cmd: 'docker pull renovate/go:latest' },
       { cmd: 'docker ps --filter name=renovate_go -aq' },
       {
-        cmd: 'docker run --rm --name=renovate_go --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e GOPROXY -e GOPRIVATE -e GONOPROXY -e GONOSUMDB -e GOINSECURE -e GOFLAGS -e CGO_ENABLED -e BUILDPACK_CACHE_DIR -w "/tmp/github/some/repo" renovate/go:latest bash -l -c "go get -d -t ./... && go mod tidy -compat=1.17 && go mod tidy -compat=1.17"',
+        cmd: 'docker run --rm --name=renovate_go --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e GOPROXY -e GOPRIVATE -e GONOPROXY -e GONOSUMDB -e GOINSECURE -e GOFLAGS -e CGO_ENABLED -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" renovate/go:latest bash -l -c "go get -d -t ./... && go mod tidy -compat=1.17 && go mod tidy -compat=1.17"',
         options: { cwd: '/tmp/github/some/repo' },
       },
     ]);
diff --git a/lib/modules/manager/gradle-wrapper/artifacts.spec.ts b/lib/modules/manager/gradle-wrapper/artifacts.spec.ts
index bde60af989..a5d34e1d1e 100644
--- a/lib/modules/manager/gradle-wrapper/artifacts.spec.ts
+++ b/lib/modules/manager/gradle-wrapper/artifacts.spec.ts
@@ -208,6 +208,7 @@ describe('modules/manager/gradle-wrapper/artifacts', () => {
             '-v "/tmp/cache":"/tmp/cache" ' +
             '-e GRADLE_OPTS ' +
             '-e BUILDPACK_CACHE_DIR ' +
+            '-e CONTAINERBASE_CACHE_DIR ' +
             '-w "/tmp/github/some/repo" ' +
             'renovate/sidecar' +
             ' bash -l -c "' +
diff --git a/lib/modules/manager/helmv3/__snapshots__/artifacts.spec.ts.snap b/lib/modules/manager/helmv3/__snapshots__/artifacts.spec.ts.snap
index b0ecb5b090..b4852882b4 100644
--- a/lib/modules/manager/helmv3/__snapshots__/artifacts.spec.ts.snap
+++ b/lib/modules/manager/helmv3/__snapshots__/artifacts.spec.ts.snap
@@ -569,12 +569,13 @@ exports[`modules/manager/helmv3/artifacts returns updated Chart.lock with docker
     },
   },
   {
-    "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e HELM_EXPERIMENTAL_OCI -e BUILDPACK_CACHE_DIR -w "/tmp/github/some/repo" renovate/sidecar bash -l -c "install-tool helm v3.7.2 && helm repo add repo-test --registry-config /tmp/renovate/cache/__renovate-private-cache/registry.json --repository-config /tmp/renovate/cache/__renovate-private-cache/repositories.yaml --repository-cache /tmp/renovate/cache/__renovate-private-cache/repositories https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable && helm dependency update --registry-config /tmp/renovate/cache/__renovate-private-cache/registry.json --repository-config /tmp/renovate/cache/__renovate-private-cache/repositories.yaml --repository-cache /tmp/renovate/cache/__renovate-private-cache/repositories ''"",
+    "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e HELM_EXPERIMENTAL_OCI -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" renovate/sidecar bash -l -c "install-tool helm v3.7.2 && helm repo add repo-test --registry-config /tmp/renovate/cache/__renovate-private-cache/registry.json --repository-config /tmp/renovate/cache/__renovate-private-cache/repositories.yaml --repository-cache /tmp/renovate/cache/__renovate-private-cache/repositories https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable && helm dependency update --registry-config /tmp/renovate/cache/__renovate-private-cache/registry.json --repository-config /tmp/renovate/cache/__renovate-private-cache/repositories.yaml --repository-cache /tmp/renovate/cache/__renovate-private-cache/repositories ''"",
     "options": {
       "cwd": "/tmp/github/some/repo",
       "encoding": "utf-8",
       "env": {
         "BUILDPACK_CACHE_DIR": "/tmp/renovate/cache/containerbase",
+        "CONTAINERBASE_CACHE_DIR": "/tmp/renovate/cache/containerbase",
         "HELM_EXPERIMENTAL_OCI": "1",
         "HOME": "/home/user",
         "HTTPS_PROXY": "https://example.com",
@@ -729,12 +730,13 @@ exports[`modules/manager/helmv3/artifacts sets repositories from registryAliases
     },
   },
   {
-    "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e HELM_EXPERIMENTAL_OCI -e BUILDPACK_CACHE_DIR -w "/tmp/github/some/repo" renovate/sidecar bash -l -c "install-tool helm v3.7.2 && helm repo add stable --registry-config /tmp/renovate/cache/__renovate-private-cache/registry.json --repository-config /tmp/renovate/cache/__renovate-private-cache/repositories.yaml --repository-cache /tmp/renovate/cache/__renovate-private-cache/repositories the_stable_url && helm repo add repo1 --registry-config /tmp/renovate/cache/__renovate-private-cache/registry.json --repository-config /tmp/renovate/cache/__renovate-private-cache/repositories.yaml --repository-cache /tmp/renovate/cache/__renovate-private-cache/repositories the_repo1_url && helm repo add repo-test --registry-config /tmp/renovate/cache/__renovate-private-cache/registry.json --repository-config /tmp/renovate/cache/__renovate-private-cache/repositories.yaml --repository-cache /tmp/renovate/cache/__renovate-private-cache/repositories https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable && helm dependency update --registry-config /tmp/renovate/cache/__renovate-private-cache/registry.json --repository-config /tmp/renovate/cache/__renovate-private-cache/repositories.yaml --repository-cache /tmp/renovate/cache/__renovate-private-cache/repositories ''"",
+    "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e HELM_EXPERIMENTAL_OCI -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" renovate/sidecar bash -l -c "install-tool helm v3.7.2 && helm repo add stable --registry-config /tmp/renovate/cache/__renovate-private-cache/registry.json --repository-config /tmp/renovate/cache/__renovate-private-cache/repositories.yaml --repository-cache /tmp/renovate/cache/__renovate-private-cache/repositories the_stable_url && helm repo add repo1 --registry-config /tmp/renovate/cache/__renovate-private-cache/registry.json --repository-config /tmp/renovate/cache/__renovate-private-cache/repositories.yaml --repository-cache /tmp/renovate/cache/__renovate-private-cache/repositories the_repo1_url && helm repo add repo-test --registry-config /tmp/renovate/cache/__renovate-private-cache/registry.json --repository-config /tmp/renovate/cache/__renovate-private-cache/repositories.yaml --repository-cache /tmp/renovate/cache/__renovate-private-cache/repositories https://gitlab.com/api/v4/projects/xxxxxxx/packages/helm/stable && helm dependency update --registry-config /tmp/renovate/cache/__renovate-private-cache/registry.json --repository-config /tmp/renovate/cache/__renovate-private-cache/repositories.yaml --repository-cache /tmp/renovate/cache/__renovate-private-cache/repositories ''"",
     "options": {
       "cwd": "/tmp/github/some/repo",
       "encoding": "utf-8",
       "env": {
         "BUILDPACK_CACHE_DIR": "/tmp/renovate/cache/containerbase",
+        "CONTAINERBASE_CACHE_DIR": "/tmp/renovate/cache/containerbase",
         "HELM_EXPERIMENTAL_OCI": "1",
         "HOME": "/home/user",
         "HTTPS_PROXY": "https://example.com",
diff --git a/lib/modules/manager/mix/__snapshots__/artifacts.spec.ts.snap b/lib/modules/manager/mix/__snapshots__/artifacts.spec.ts.snap
index b246826183..8970d0fae2 100644
--- a/lib/modules/manager/mix/__snapshots__/artifacts.spec.ts.snap
+++ b/lib/modules/manager/mix/__snapshots__/artifacts.spec.ts.snap
@@ -21,12 +21,13 @@ exports[`modules/manager/mix/artifacts authenticates to private repositories 2`]
     },
   },
   {
-    "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 -w "/tmp/github/some/repo" renovate/sidecar bash -l -c "install-tool erlang 24.3.4.2 && install-tool elixir v1.13.4 && mix hex.organization auth renovate_test --key valid_test_token && mix deps.update private_package other_package"",
+    "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" renovate/sidecar bash -l -c "install-tool erlang 24.3.4.2 && install-tool elixir v1.13.4 && mix hex.organization auth renovate_test --key valid_test_token && mix deps.update private_package other_package"",
     "options": {
       "cwd": "/tmp/github/some/repo",
       "encoding": "utf-8",
       "env": {
         "BUILDPACK_CACHE_DIR": "/tmp/cache/containerbase",
+        "CONTAINERBASE_CACHE_DIR": "/tmp/cache/containerbase",
         "HOME": "/home/user",
         "HTTPS_PROXY": "https://example.com",
         "HTTP_PROXY": "http://example.com",
@@ -80,12 +81,13 @@ exports[`modules/manager/mix/artifacts returns updated mix.lock 1`] = `
     },
   },
   {
-    "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 -w "/tmp/github/some/repo" renovate/sidecar bash -l -c "install-tool erlang 24.3.4.2 && install-tool elixir 1.13.4 && mix deps.update plug"",
+    "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" renovate/sidecar bash -l -c "install-tool erlang 24.3.4.2 && install-tool elixir 1.13.4 && mix deps.update plug"",
     "options": {
       "cwd": "/tmp/github/some/repo",
       "encoding": "utf-8",
       "env": {
         "BUILDPACK_CACHE_DIR": "/tmp/cache/containerbase",
+        "CONTAINERBASE_CACHE_DIR": "/tmp/cache/containerbase",
         "HOME": "/home/user",
         "HTTPS_PROXY": "https://example.com",
         "HTTP_PROXY": "http://example.com",
diff --git a/lib/modules/manager/npm/post-update/lerna.spec.ts b/lib/modules/manager/npm/post-update/lerna.spec.ts
index 0dd49e2ac3..9746d1b049 100644
--- a/lib/modules/manager/npm/post-update/lerna.spec.ts
+++ b/lib/modules/manager/npm/post-update/lerna.spec.ts
@@ -154,6 +154,7 @@ describe('modules/manager/npm/post-update/lerna', () => {
             'docker run --rm --name=renovate_sidecar --label=renovate_child ' +
             '-v "/tmp/cache":"/tmp/cache" ' +
             '-e BUILDPACK_CACHE_DIR ' +
+            '-e CONTAINERBASE_CACHE_DIR ' +
             '-w "some-dir" renovate/sidecar ' +
             'bash -l -c "' +
             'install-tool node 16.16.0 ' +
diff --git a/lib/modules/manager/npm/post-update/npm.spec.ts b/lib/modules/manager/npm/post-update/npm.spec.ts
index 7a8ae8a90b..73703f8ef0 100644
--- a/lib/modules/manager/npm/post-update/npm.spec.ts
+++ b/lib/modules/manager/npm/post-update/npm.spec.ts
@@ -265,6 +265,7 @@ describe('modules/manager/npm/post-update/npm', () => {
           'docker run --rm --name=renovate_sidecar --label=renovate_child ' +
           '-v "/tmp":"/tmp" ' +
           '-e BUILDPACK_CACHE_DIR ' +
+          '-e CONTAINERBASE_CACHE_DIR ' +
           '-w "some-dir" ' +
           'renovate/sidecar ' +
           'bash -l -c "' +
diff --git a/lib/modules/manager/npm/post-update/pnpm.spec.ts b/lib/modules/manager/npm/post-update/pnpm.spec.ts
index d0c5e4c3c0..7bf17307b2 100644
--- a/lib/modules/manager/npm/post-update/pnpm.spec.ts
+++ b/lib/modules/manager/npm/post-update/pnpm.spec.ts
@@ -209,6 +209,7 @@ describe('modules/manager/npm/post-update/pnpm', () => {
           'docker run --rm --name=renovate_sidecar --label=renovate_child ' +
           '-v "/tmp":"/tmp" ' +
           '-e BUILDPACK_CACHE_DIR ' +
+          '-e CONTAINERBASE_CACHE_DIR ' +
           '-w "some-dir" ' +
           'renovate/sidecar ' +
           'bash -l -c "' +
diff --git a/lib/modules/manager/npm/post-update/yarn.spec.ts b/lib/modules/manager/npm/post-update/yarn.spec.ts
index 18f4c63c61..fd931c487d 100644
--- a/lib/modules/manager/npm/post-update/yarn.spec.ts
+++ b/lib/modules/manager/npm/post-update/yarn.spec.ts
@@ -559,7 +559,7 @@ describe('modules/manager/npm/post-update/yarn', () => {
       { cmd: 'docker pull renovate/sidecar', options },
       {
         cmd:
-          `docker run --rm --name=renovate_sidecar --label=renovate_child -v ".":"." -v "/tmp/cache":"/tmp/cache" -e CI -e BUILDPACK_CACHE_DIR -w "some-dir" renovate/sidecar ` +
+          `docker run --rm --name=renovate_sidecar --label=renovate_child -v ".":"." -v "/tmp/cache":"/tmp/cache" -e CI -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "some-dir" renovate/sidecar ` +
           `bash -l -c "` +
           `install-tool node 16.16.0` +
           ` && ` +
diff --git a/lib/modules/manager/nuget/__snapshots__/artifacts.spec.ts.snap b/lib/modules/manager/nuget/__snapshots__/artifacts.spec.ts.snap
index 201b72e370..9a15a57672 100644
--- a/lib/modules/manager/nuget/__snapshots__/artifacts.spec.ts.snap
+++ b/lib/modules/manager/nuget/__snapshots__/artifacts.spec.ts.snap
@@ -149,12 +149,13 @@ exports[`modules/manager/nuget/artifacts supports docker mode 1`] = `
     },
   },
   {
-    "cmd": "docker run --rm --name=renovate_dotnet --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e NUGET_PACKAGES -e BUILDPACK_CACHE_DIR -w "/tmp/github/some/repo" renovate/dotnet bash -l -c "dotnet restore project.csproj --force-evaluate --configfile /tmp/renovate/cache/__renovate-private-cache/nuget/nuget.config"",
+    "cmd": "docker run --rm --name=renovate_dotnet --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e NUGET_PACKAGES -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" renovate/dotnet bash -l -c "dotnet restore project.csproj --force-evaluate --configfile /tmp/renovate/cache/__renovate-private-cache/nuget/nuget.config"",
     "options": {
       "cwd": "/tmp/github/some/repo",
       "encoding": "utf-8",
       "env": {
         "BUILDPACK_CACHE_DIR": "/tmp/renovate/cache/containerbase",
+        "CONTAINERBASE_CACHE_DIR": "/tmp/renovate/cache/containerbase",
         "HOME": "/home/user",
         "HTTPS_PROXY": "https://example.com",
         "HTTP_PROXY": "http://example.com",
diff --git a/lib/modules/manager/pip-compile/artifacts.spec.ts b/lib/modules/manager/pip-compile/artifacts.spec.ts
index 1da97714c8..563d4ee248 100644
--- a/lib/modules/manager/pip-compile/artifacts.spec.ts
+++ b/lib/modules/manager/pip-compile/artifacts.spec.ts
@@ -119,6 +119,7 @@ describe('modules/manager/pip-compile/artifacts', () => {
           '-v "/tmp/renovate/cache":"/tmp/renovate/cache" ' +
           '-e PIP_CACHE_DIR ' +
           '-e BUILDPACK_CACHE_DIR ' +
+          '-e CONTAINERBASE_CACHE_DIR ' +
           '-w "/tmp/github/some/repo" ' +
           'renovate/sidecar ' +
           'bash -l -c "' +
@@ -229,6 +230,7 @@ describe('modules/manager/pip-compile/artifacts', () => {
           '-v "/tmp/renovate/cache":"/tmp/renovate/cache" ' +
           '-e PIP_CACHE_DIR ' +
           '-e BUILDPACK_CACHE_DIR ' +
+          '-e CONTAINERBASE_CACHE_DIR ' +
           '-w "/tmp/github/some/repo" ' +
           'renovate/sidecar ' +
           'bash -l -c "' +
diff --git a/lib/modules/manager/pip_requirements/artifacts.spec.ts b/lib/modules/manager/pip_requirements/artifacts.spec.ts
index f063994808..1031300d02 100644
--- a/lib/modules/manager/pip_requirements/artifacts.spec.ts
+++ b/lib/modules/manager/pip_requirements/artifacts.spec.ts
@@ -216,6 +216,7 @@ describe('modules/manager/pip_requirements/artifacts', () => {
           '-v "/tmp/renovate/cache":"/tmp/renovate/cache" ' +
           '-e PIP_CACHE_DIR ' +
           '-e BUILDPACK_CACHE_DIR ' +
+          '-e CONTAINERBASE_CACHE_DIR ' +
           '-w "/tmp/github/some/repo" ' +
           'renovate/sidecar ' +
           'bash -l -c "' +
diff --git a/lib/modules/manager/pipenv/__snapshots__/artifacts.spec.ts.snap b/lib/modules/manager/pipenv/__snapshots__/artifacts.spec.ts.snap
index 03abf52d6b..231d1d4330 100644
--- a/lib/modules/manager/pipenv/__snapshots__/artifacts.spec.ts.snap
+++ b/lib/modules/manager/pipenv/__snapshots__/artifacts.spec.ts.snap
@@ -111,12 +111,13 @@ exports[`modules/manager/pipenv/artifacts supports docker mode 1`] = `
     },
   },
   {
-    "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e PIPENV_CACHE_DIR -e PIP_CACHE_DIR -e BUILDPACK_CACHE_DIR -w "/tmp/github/some/repo" renovate/sidecar bash -l -c "install-tool python 3.7.6 && pip install --user pipenv && pipenv lock"",
+    "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e PIPENV_CACHE_DIR -e PIP_CACHE_DIR -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" renovate/sidecar bash -l -c "install-tool python 3.7.6 && pip install --user pipenv && pipenv lock"",
     "options": {
       "cwd": "/tmp/github/some/repo",
       "encoding": "utf-8",
       "env": {
         "BUILDPACK_CACHE_DIR": "/tmp/renovate/cache/containerbase",
+        "CONTAINERBASE_CACHE_DIR": "/tmp/renovate/cache/containerbase",
         "HOME": "/home/user",
         "HTTPS_PROXY": "https://example.com",
         "HTTP_PROXY": "http://example.com",
@@ -149,12 +150,13 @@ exports[`modules/manager/pipenv/artifacts uses pipenv version from Pipfile 1`] =
     },
   },
   {
-    "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e PIPENV_CACHE_DIR -e BUILDPACK_CACHE_DIR -w "/tmp/github/some/repo" renovate/sidecar bash -l -c "install-tool python 3.10.2 && pip install --user pipenv==2020.8.13 && pipenv lock"",
+    "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e PIPENV_CACHE_DIR -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" renovate/sidecar bash -l -c "install-tool python 3.10.2 && pip install --user pipenv==2020.8.13 && pipenv lock"",
     "options": {
       "cwd": "/tmp/github/some/repo",
       "encoding": "utf-8",
       "env": {
         "BUILDPACK_CACHE_DIR": "/tmp/renovate/cache/containerbase",
+        "CONTAINERBASE_CACHE_DIR": "/tmp/renovate/cache/containerbase",
         "HOME": "/home/user",
         "HTTPS_PROXY": "https://example.com",
         "HTTP_PROXY": "http://example.com",
@@ -186,12 +188,13 @@ exports[`modules/manager/pipenv/artifacts uses pipenv version from Pipfile dev p
     },
   },
   {
-    "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e PIPENV_CACHE_DIR -e BUILDPACK_CACHE_DIR -w "/tmp/github/some/repo" renovate/sidecar bash -l -c "install-tool python 3.10.2 && pip install --user pipenv==2020.8.13 && pipenv lock"",
+    "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e PIPENV_CACHE_DIR -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" renovate/sidecar bash -l -c "install-tool python 3.10.2 && pip install --user pipenv==2020.8.13 && pipenv lock"",
     "options": {
       "cwd": "/tmp/github/some/repo",
       "encoding": "utf-8",
       "env": {
         "BUILDPACK_CACHE_DIR": "/tmp/renovate/cache/containerbase",
+        "CONTAINERBASE_CACHE_DIR": "/tmp/renovate/cache/containerbase",
         "HOME": "/home/user",
         "HTTPS_PROXY": "https://example.com",
         "HTTP_PROXY": "http://example.com",
@@ -223,12 +226,13 @@ exports[`modules/manager/pipenv/artifacts uses pipenv version from config 1`] =
     },
   },
   {
-    "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e PIPENV_CACHE_DIR -e BUILDPACK_CACHE_DIR -w "/tmp/github/some/repo" renovate/sidecar bash -l -c "install-tool python 3.10.2 && pip install --user pipenv==2020.1.1 && pipenv lock"",
+    "cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e PIPENV_CACHE_DIR -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" renovate/sidecar bash -l -c "install-tool python 3.10.2 && pip install --user pipenv==2020.1.1 && pipenv lock"",
     "options": {
       "cwd": "/tmp/github/some/repo",
       "encoding": "utf-8",
       "env": {
         "BUILDPACK_CACHE_DIR": "/tmp/renovate/cache/containerbase",
+        "CONTAINERBASE_CACHE_DIR": "/tmp/renovate/cache/containerbase",
         "HOME": "/home/user",
         "HTTPS_PROXY": "https://example.com",
         "HTTP_PROXY": "http://example.com",
diff --git a/lib/modules/manager/poetry/artifacts.spec.ts b/lib/modules/manager/poetry/artifacts.spec.ts
index e4de7a1276..4af0295f49 100644
--- a/lib/modules/manager/poetry/artifacts.spec.ts
+++ b/lib/modules/manager/poetry/artifacts.spec.ts
@@ -272,6 +272,7 @@ describe('modules/manager/poetry/artifacts', () => {
           '-v "/tmp/cache":"/tmp/cache" ' +
           '-e PIP_CACHE_DIR ' +
           '-e BUILDPACK_CACHE_DIR ' +
+          '-e CONTAINERBASE_CACHE_DIR ' +
           '-w "/tmp/github/some/repo" ' +
           'renovate/sidecar ' +
           'bash -l -c "' +
@@ -330,6 +331,7 @@ describe('modules/manager/poetry/artifacts', () => {
           '-v "/tmp/cache":"/tmp/cache" ' +
           '-e PIP_CACHE_DIR ' +
           '-e BUILDPACK_CACHE_DIR ' +
+          '-e CONTAINERBASE_CACHE_DIR ' +
           '-w "/tmp/github/some/repo" ' +
           'renovate/sidecar ' +
           'bash -l -c "' +
diff --git a/lib/util/exec/containerbase.spec.ts b/lib/util/exec/containerbase.spec.ts
index 19646bc931..67210eb832 100644
--- a/lib/util/exec/containerbase.spec.ts
+++ b/lib/util/exec/containerbase.spec.ts
@@ -17,6 +17,7 @@ describe('util/exec/containerbase', () => {
     beforeEach(() => {
       GlobalConfig.reset();
       delete process.env.BUILDPACK;
+      delete process.env.CONTAINERBASE;
     });
 
     it('returns false if binarySource is not install', () => {
@@ -30,7 +31,7 @@ describe('util/exec/containerbase', () => {
 
     it('returns false if any unsupported tools', () => {
       GlobalConfig.set({ binarySource: 'install' });
-      process.env.BUILDPACK = 'true';
+      process.env.CONTAINERBASE = 'true';
       const toolConstraints: ToolConstraint[] = [
         { toolName: 'node' },
         { toolName: 'invalid' },
@@ -40,7 +41,7 @@ describe('util/exec/containerbase', () => {
 
     it('returns true if supported tools', () => {
       GlobalConfig.set({ binarySource: 'install' });
-      process.env.BUILDPACK = 'true';
+      process.env.CONTAINERBASE = 'true';
       const toolConstraints: ToolConstraint[] = [{ toolName: 'npm' }];
       expect(isDynamicInstall(toolConstraints)).toBeTrue();
     });
diff --git a/lib/util/exec/containerbase.ts b/lib/util/exec/containerbase.ts
index 8679779fc5..5b9da01655 100644
--- a/lib/util/exec/containerbase.ts
+++ b/lib/util/exec/containerbase.ts
@@ -112,8 +112,8 @@ export function supportsDynamicInstall(toolName: string): boolean {
   return !!allToolConfig[toolName];
 }
 
-export function isBuildpack(): boolean {
-  return !!process.env.BUILDPACK;
+export function isContainerbase(): boolean {
+  return !!process.env.CONTAINERBASE || !!process.env.BUILDPACK;
 }
 
 export function isDynamicInstall(
@@ -123,7 +123,7 @@ export function isDynamicInstall(
   if (binarySource !== 'install') {
     return false;
   }
-  if (!isBuildpack()) {
+  if (!isContainerbase()) {
     logger.warn(
       'binarySource=install is only compatible with images derived from github.com/containerbase'
     );
diff --git a/lib/util/exec/index.spec.ts b/lib/util/exec/index.spec.ts
index 11370a1c93..aa4a5f0bbf 100644
--- a/lib/util/exec/index.spec.ts
+++ b/lib/util/exec/index.spec.ts
@@ -75,13 +75,15 @@ describe('util/exec/index', () => {
   const dockerPullOpts = { encoding };
   const dockerRemoveOpts = dockerPullOpts;
 
-  const buildpackEnv = {
+  const containerbaseEnv = {
     ...envMock.basic,
     BUILDPACK_CACHE_DIR: `${cacheDir}containerbase`,
+    CONTAINERBASE_CACHE_DIR: `${cacheDir}containerbase`,
   };
-  const buildpackEnvFiltered = {
+  const containerbaseEnvFiltered = {
     ...envMock.filtered,
     BUILDPACK_CACHE_DIR: `${cacheDir}containerbase`,
+    CONTAINERBASE_CACHE_DIR: `${cacheDir}containerbase`,
   };
 
   const testInputs: [string, TestInput][] = [
@@ -204,7 +206,7 @@ describe('util/exec/index', () => {
         outCmd: [
           dockerPullCmd,
           dockerRemoveCmd,
-          `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e BUILDPACK_CACHE_DIR ${defaultCwd} ${fullImage} bash -l -c "${inCmd}"`,
+          `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR ${defaultCwd} ${fullImage} bash -l -c "${inCmd}"`,
         ],
         outOpts: [
           dockerPullOpts,
@@ -212,7 +214,7 @@ describe('util/exec/index', () => {
           {
             cwd,
             encoding,
-            env: buildpackEnv,
+            env: containerbaseEnv,
             timeout: 900000,
             maxBuffer: 10485760,
           },
@@ -239,7 +241,7 @@ describe('util/exec/index', () => {
           {
             cwd,
             encoding,
-            env: buildpackEnvFiltered,
+            env: containerbaseEnvFiltered,
             timeout: 900000,
             maxBuffer: 10485760,
           },
@@ -266,7 +268,7 @@ describe('util/exec/index', () => {
         outCmd: [
           dockerPullCmd,
           dockerRemoveCmd,
-          `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e SELECTED_ENV_VAR -e BUILDPACK_CACHE_DIR ${defaultCwd} ${fullImage} bash -l -c "${inCmd}"`,
+          `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e SELECTED_ENV_VAR -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR ${defaultCwd} ${fullImage} bash -l -c "${inCmd}"`,
         ],
         outOpts: [
           dockerPullOpts,
@@ -274,7 +276,7 @@ describe('util/exec/index', () => {
           {
             cwd,
             encoding,
-            env: buildpackEnvFiltered,
+            env: containerbaseEnvFiltered,
             timeout: 900000,
             maxBuffer: 10485760,
           },
@@ -294,7 +296,7 @@ describe('util/exec/index', () => {
           {
             cwd,
             encoding,
-            env: { ...buildpackEnv, SELECTED_ENV_VAR: 'Default value' },
+            env: { ...containerbaseEnv, SELECTED_ENV_VAR: 'Default value' },
             timeout: 900000,
             maxBuffer: 10485760,
           },
@@ -316,7 +318,7 @@ describe('util/exec/index', () => {
         outCmd: [
           dockerPullCmd,
           dockerRemoveCmd,
-          `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e SELECTED_ENV_VAR -e BUILDPACK_CACHE_DIR ${defaultCwd} ${fullImage} bash -l -c "${inCmd}"`,
+          `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e SELECTED_ENV_VAR -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR ${defaultCwd} ${fullImage} bash -l -c "${inCmd}"`,
         ],
         outOpts: [
           dockerPullOpts,
@@ -324,7 +326,7 @@ describe('util/exec/index', () => {
           {
             cwd,
             encoding,
-            env: { ...buildpackEnv, SELECTED_ENV_VAR: 'Default value' },
+            env: { ...containerbaseEnv, SELECTED_ENV_VAR: 'Default value' },
             timeout: 900000,
             maxBuffer: 10485760,
           },
@@ -342,7 +344,7 @@ describe('util/exec/index', () => {
         outCmd: [
           `${dockerPullCmd}:${tag}`,
           dockerRemoveCmd,
-          `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e BUILDPACK_CACHE_DIR ${defaultCwd} ${fullImage}:${tag} bash -l -c "${inCmd}"`,
+          `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR ${defaultCwd} ${fullImage}:${tag} bash -l -c "${inCmd}"`,
         ],
         outOpts: [
           dockerPullOpts,
@@ -350,7 +352,7 @@ describe('util/exec/index', () => {
           {
             cwd,
             encoding,
-            env: buildpackEnv,
+            env: containerbaseEnv,
             timeout: 900000,
             maxBuffer: 10485760,
           },
@@ -368,7 +370,7 @@ describe('util/exec/index', () => {
         outCmd: [
           dockerPullCmd,
           dockerRemoveCmd,
-          `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -v "${volume_1}":"${volume_1}" -v "${volume_2_from}":"${volume_2_to}" -e BUILDPACK_CACHE_DIR -w "${cwd}" ${fullImage} bash -l -c "${inCmd}"`,
+          `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -v "${volume_1}":"${volume_1}" -v "${volume_2_from}":"${volume_2_to}" -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "${cwd}" ${fullImage} bash -l -c "${inCmd}"`,
         ],
         outOpts: [
           dockerPullOpts,
@@ -376,7 +378,7 @@ describe('util/exec/index', () => {
           {
             cwd,
             encoding,
-            env: buildpackEnv,
+            env: containerbaseEnv,
             timeout: 900000,
             maxBuffer: 10485760,
           },
@@ -394,7 +396,7 @@ describe('util/exec/index', () => {
         outCmd: [
           dockerPullCmd,
           dockerRemoveCmd,
-          `docker run --rm --name=${name} --label=renovate_child --user=foobar ${defaultVolumes} -e BUILDPACK_CACHE_DIR -w "${cwd}" ${fullImage} bash -l -c "${inCmd}"`,
+          `docker run --rm --name=${name} --label=renovate_child --user=foobar ${defaultVolumes} -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "${cwd}" ${fullImage} bash -l -c "${inCmd}"`,
         ],
         outOpts: [
           dockerPullOpts,
@@ -402,7 +404,7 @@ describe('util/exec/index', () => {
           {
             cwd,
             encoding,
-            env: buildpackEnv,
+            env: containerbaseEnv,
             timeout: 900000,
             maxBuffer: 10485760,
           },
@@ -423,7 +425,7 @@ describe('util/exec/index', () => {
         outCmd: [
           `docker pull ghcr.io/renovatebot/image`,
           dockerRemoveCmd,
-          `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e BUILDPACK_CACHE_DIR -w "${cwd}" ghcr.io/renovatebot/image bash -l -c "${inCmd}"`,
+          `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "${cwd}" ghcr.io/renovatebot/image bash -l -c "${inCmd}"`,
         ],
         outOpts: [
           dockerPullOpts,
@@ -431,7 +433,7 @@ describe('util/exec/index', () => {
           {
             cwd,
             encoding,
-            env: buildpackEnv,
+            env: containerbaseEnv,
             timeout: 900000,
             maxBuffer: 10485760,
           },
@@ -452,7 +454,7 @@ describe('util/exec/index', () => {
         outCmd: [
           dockerPullCmd,
           `docker ps --filter name=myprefix_${image} -aq`,
-          `docker run --rm --name=myprefix_${image} --label=myprefix_child ${defaultVolumes} -e BUILDPACK_CACHE_DIR -w "${cwd}" ${fullImage} bash -l -c "${inCmd}"`,
+          `docker run --rm --name=myprefix_${image} --label=myprefix_child ${defaultVolumes} -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "${cwd}" ${fullImage} bash -l -c "${inCmd}"`,
         ],
         outOpts: [
           dockerPullOpts,
@@ -460,7 +462,7 @@ describe('util/exec/index', () => {
           {
             cwd,
             encoding,
-            env: buildpackEnv,
+            env: containerbaseEnv,
             timeout: 900000,
             maxBuffer: 10485760,
           },
@@ -486,7 +488,7 @@ describe('util/exec/index', () => {
         outCmd: [
           dockerPullCmd,
           dockerRemoveCmd,
-          `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e BUILDPACK_CACHE_DIR -w "${cwd}" ${fullImage} bash -l -c "preCommand1 && preCommand2 && ${inCmd}"`,
+          `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "${cwd}" ${fullImage} bash -l -c "preCommand1 && preCommand2 && ${inCmd}"`,
         ],
         outOpts: [
           dockerPullOpts,
@@ -494,7 +496,7 @@ describe('util/exec/index', () => {
           {
             cwd,
             encoding,
-            env: buildpackEnv,
+            env: containerbaseEnv,
             timeout: 900000,
             maxBuffer: 10485760,
           },
@@ -516,7 +518,7 @@ describe('util/exec/index', () => {
         outCmd: [
           dockerPullCmd,
           dockerRemoveCmd,
-          `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e BUILDPACK_CACHE_DIR -w "${cwd}" ${fullImage} bash -l -c "${inCmd}"`,
+          `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "${cwd}" ${fullImage} bash -l -c "${inCmd}"`,
         ],
         outOpts: [
           dockerPullOpts,
@@ -524,7 +526,7 @@ describe('util/exec/index', () => {
           {
             cwd,
             encoding,
-            env: buildpackEnv,
+            env: containerbaseEnv,
             timeout: 900000,
             maxBuffer: 10485760,
           },
@@ -546,7 +548,7 @@ describe('util/exec/index', () => {
           {
             cwd,
             encoding,
-            env: buildpackEnv,
+            env: containerbaseEnv,
             timeout: 20 * 60 * 1000,
             maxBuffer: 10485760,
           },
@@ -588,7 +590,7 @@ describe('util/exec/index', () => {
           {
             cwd,
             encoding,
-            env: buildpackEnv,
+            env: containerbaseEnv,
             timeout: 900000,
             maxBuffer: 1024,
           },
@@ -609,7 +611,7 @@ describe('util/exec/index', () => {
             cwd,
             encoding,
             env: {
-              ...buildpackEnv,
+              ...containerbaseEnv,
               CUSTOM_KEY: 'CUSTOM_VALUE',
             },
             timeout: 900000,
@@ -637,7 +639,7 @@ describe('util/exec/index', () => {
             cwd,
             encoding,
             env: {
-              ...buildpackEnv,
+              ...containerbaseEnv,
               CUSTOM_KEY: 'CUSTOM_OVERRIDEN_VALUE',
             },
             timeout: 900000,
@@ -662,7 +664,7 @@ describe('util/exec/index', () => {
         outCmd: [
           dockerPullCmd,
           dockerRemoveCmd,
-          `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e CUSTOM_KEY -e BUILDPACK_CACHE_DIR ${defaultCwd} ${fullImage} bash -l -c "${inCmd}"`,
+          `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e CUSTOM_KEY -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR ${defaultCwd} ${fullImage} bash -l -c "${inCmd}"`,
         ],
         outOpts: [
           dockerPullOpts,
@@ -671,7 +673,7 @@ describe('util/exec/index', () => {
             cwd,
             encoding,
             env: {
-              ...buildpackEnv,
+              ...containerbaseEnv,
               CUSTOM_KEY: 'CUSTOM_VALUE',
             },
             timeout: 900000,
@@ -696,7 +698,7 @@ describe('util/exec/index', () => {
         outCmd: [
           dockerPullCmd,
           dockerRemoveCmd,
-          `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e CUSTOM_KEY -e BUILDPACK_CACHE_DIR ${defaultCwd} ${fullImage} bash -l -c "${inCmd}"`,
+          `docker run --rm --name=${name} --label=renovate_child ${defaultVolumes} -e CUSTOM_KEY -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR ${defaultCwd} ${fullImage} bash -l -c "${inCmd}"`,
         ],
         outOpts: [
           dockerPullOpts,
@@ -705,7 +707,7 @@ describe('util/exec/index', () => {
             cwd,
             encoding,
             env: {
-              ...buildpackEnv,
+              ...containerbaseEnv,
               CUSTOM_KEY: 'CUSTOM_OVERRIDEN_VALUE',
             },
             timeout: 900000,
@@ -824,15 +826,15 @@ describe('util/exec/index', () => {
       `echo hello`,
       `docker pull renovate/image`,
       `docker ps --filter name=renovate_image -aq`,
-      `docker run --rm --name=renovate_image --label=renovate_child ${defaultCacheVolume} -e BUILDPACK_CACHE_DIR renovate/image bash -l -c "echo hello"`,
+      `docker run --rm --name=renovate_image --label=renovate_child ${defaultCacheVolume} -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR renovate/image bash -l -c "echo hello"`,
       `docker ps --filter name=renovate_image -aq`,
-      `docker run --rm --name=renovate_image --label=renovate_child ${defaultCacheVolume} -e BUILDPACK_CACHE_DIR renovate/image bash -l -c "echo hello"`,
+      `docker run --rm --name=renovate_image --label=renovate_child ${defaultCacheVolume} -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR renovate/image bash -l -c "echo hello"`,
       `echo hello`,
       `echo hello`,
       `docker ps --filter name=renovate_image -aq`,
-      `docker run --rm --name=renovate_image --label=renovate_child ${defaultCacheVolume} -e BUILDPACK_CACHE_DIR renovate/image bash -l -c "echo hello"`,
+      `docker run --rm --name=renovate_image --label=renovate_child ${defaultCacheVolume} -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR renovate/image bash -l -c "echo hello"`,
       `docker ps --filter name=renovate_image -aq`,
-      `docker run --rm --name=renovate_image --label=renovate_child ${defaultCacheVolume} -e BUILDPACK_CACHE_DIR renovate/image bash -l -c "echo hello"`,
+      `docker run --rm --name=renovate_image --label=renovate_child ${defaultCacheVolume} -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR renovate/image bash -l -c "echo hello"`,
     ]);
   });
 
@@ -842,7 +844,7 @@ describe('util/exec/index', () => {
       throw new Error('some error occurred');
     });
     GlobalConfig.set({ ...globalConfig, binarySource: 'install' });
-    process.env.BUILDPACK = 'true';
+    process.env.CONTAINERBASE = 'true';
     const promise = exec('foobar', { toolConstraints: [{ toolName: 'npm' }] });
     await expect(promise).rejects.toThrow('No tool releases found.');
   });
@@ -856,7 +858,7 @@ describe('util/exec/index', () => {
     });
 
     GlobalConfig.set({ ...globalConfig, binarySource: 'install' });
-    process.env.BUILDPACK = 'true';
+    process.env.CONTAINERBASE = 'true';
     await exec('foobar', { preCommands: ['install-pip foobar'] });
     expect(actualCmd).toEqual([`install-pip foobar`, `foobar`]);
   });
diff --git a/lib/util/exec/index.ts b/lib/util/exec/index.ts
index 8e9adfc058..8b108045b0 100644
--- a/lib/util/exec/index.ts
+++ b/lib/util/exec/index.ts
@@ -105,9 +105,10 @@ async function prepareRawExec(
     GlobalConfig.get();
 
   if (binarySource === 'docker' || binarySource === 'install') {
-    logger.debug(`Setting BUILDPACK_CACHE_DIR to ${containerbaseDir!}`);
+    logger.debug(`Setting CONTAINERBASE_CACHE_DIR to ${containerbaseDir!}`);
     opts.env ??= {};
     opts.env.BUILDPACK_CACHE_DIR = containerbaseDir;
+    opts.env.CONTAINERBASE_CACHE_DIR = containerbaseDir;
   }
 
   const rawOptions = getRawExecOptions(opts);
@@ -124,6 +125,7 @@ async function prepareRawExec(
     const envVars = [
       ...dockerEnvVars(extraEnv, childEnv),
       'BUILDPACK_CACHE_DIR',
+      'CONTAINERBASE_CACHE_DIR',
     ];
     const cwd = getCwd(opts);
     const dockerOptions: DockerOptions = { ...docker, cwd, envVars };
-- 
GitLab