Skip to content

Commit

Permalink
fix(docker): set interactive flag, remove tty flag #9
Browse files Browse the repository at this point in the history
  • Loading branch information
XargsUK committed Oct 2, 2024
1 parent 375ff36 commit 2bae269
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/checkov/checkovRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const getDockerRunParams = (workspaceRoot: string | undefined, filePath: string,
const [configFileDockerParams, configFileCheckovParams] = getPathParamsForDockerRun(configMountDir, configFilePath, '--config-file');
const [externalChecksDockerParams, externalChecksCheckovParams] = getPathParamsForDockerRun(externalChecksMountDir, externalChecksDir, '--external-checks-dir');

const dockerParams = ['run', '--rm', '--tty', '--interactive', nameParam, ...debugLogParams, '--env', 'BC_SOURCE=vscode', '--env', `BC_SOURCE_VERSION=${extensionVersion}`,
const dockerParams = ['run', '--rm', '--interactive', nameParam, ...debugLogParams, '--env', 'BC_SOURCE=vscode', '--env', `BC_SOURCE_VERSION=${extensionVersion}`,
'-v', `"${mountRoot}:${dockerMountDir}"`, ...caCertDockerParams, ...configFileDockerParams, ...externalChecksDockerParams, '-w', dockerMountDir];

return [...dockerParams, image, ...configFileCheckovParams, ...caCertCheckovParams, ...externalChecksCheckovParams, '-f', filePathToScan];
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export const getWorkspacePath = (logger: winston.Logger): string | void => {
};

export const runVersionCommand = async (logger: winston.Logger, checkovPath: string, checkovVersion: string | undefined): Promise<string> => {
const command = checkovPath === 'docker' ? `docker run --rm bridgecrew/checkov:${checkovVersion} -v` : `${checkovPath} -v`;
const command = checkovPath === 'docker' ? `docker run --rm --interactive bridgecrew/checkov:${checkovVersion} -v` : `${checkovPath} -v`;
logger.debug(`Version command: ${command}`);
const resp = await asyncExec(command);
logger.debug(`Response from version command: ${resp[0]}`);
Expand Down

0 comments on commit 2bae269

Please sign in to comment.