Skip to content

Commit

Permalink
fix: log containerbaseDir (#17509)
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Aug 30, 2022
1 parent 9b1115a commit 7b1c117
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/util/exec/docker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,15 @@ export async function generateDockerCommand(
}

const volumeDirs: VolumeOption[] = [localDir, cacheDir];
if (containerbaseDir && cacheDir && !containerbaseDir.startsWith(cacheDir)) {
volumeDirs.push(containerbaseDir);
if (containerbaseDir) {
if (cacheDir && containerbaseDir.startsWith(cacheDir)) {
logger.debug('containerbaseDir is inside cacheDir');
} else {
logger.debug('containerbaseDir is separate from cacheDir');
volumeDirs.push(containerbaseDir);
}
} else {
logger.debug('containerbaseDir is missing');
}
volumeDirs.push(...volumes);
result.push(...prepareVolumes(volumeDirs));
Expand Down
1 change: 1 addition & 0 deletions lib/util/exec/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ async function prepareRawExec(
GlobalConfig.get();

if (binarySource === 'docker' || binarySource === 'install') {
logger.debug(`Setting BUILDPACK_CACHE_DIR to ${containerbaseDir!}`);
opts.env ??= {};
opts.env.BUILDPACK_CACHE_DIR = containerbaseDir;
}
Expand Down

0 comments on commit 7b1c117

Please sign in to comment.