Skip to content

Commit

Permalink
Include Docker environment settings (#2490)
Browse files Browse the repository at this point in the history
  • Loading branch information
bwateratmsft authored Nov 12, 2020
1 parent 887a481 commit e2fdd3c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/docker/DockerodeApiClient/DockerodeApiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import * as tar from 'tar';
import { IActionContext, parseError } from 'vscode-azureextensionui';
import { CancellationToken } from 'vscode-languageclient';
import { localize } from '../../localize';
import { addDockerSettingsToEnv } from '../../utils/addDockerSettingsToEnv';
import { cloneObject } from '../../utils/cloneObject';
import { isWindows } from '../../utils/osUtils';
import { bufferToString, execStreamAsync } from '../../utils/spawnAsync';
import { DockerInfo, PruneResult } from '../Common';
Expand Down Expand Up @@ -80,7 +82,11 @@ export class DockerodeApiClient extends ContextChangeCancelClient implements Doc

dockerCommand += `"${ref}" ${commandProvider('windows').join(' ')}`;

const { stdout, stderr } = await execStreamAsync(dockerCommand, {}, token);
// Copy the Docker environment settings in
let newEnv: NodeJS.ProcessEnv = cloneObject(process.env);
addDockerSettingsToEnv(newEnv, process.env);

const { stdout, stderr } = await execStreamAsync(dockerCommand, { env: newEnv }, token);

return { stdout, stderr };
} else {
Expand Down

0 comments on commit e2fdd3c

Please sign in to comment.