Skip to content

Commit

Permalink
Option for docker interactive opt-out
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-thompson-helix committed Sep 3, 2020
1 parent bbe8b6c commit b5b79a5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions docker/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export type DockerRunParams = {
user?: DockerUserArg;
workdir?: string;
envvars?: string[];
interactive: boolean;
};

/// Options to run docker as current user
Expand Down Expand Up @@ -61,10 +62,14 @@ export function makeDockerRunCmd(img: string, params: DockerRunParams) : string[
const cmd = [
"docker",
"run",
"-t",
"-i",
"--rm",
];

if(params.interactive) {
cmd.push("--tty");
cmd.push("--interactive");
}

for (const m of params.mounts || []) {
if (m.type === "bind") {
const args = [
Expand Down

0 comments on commit b5b79a5

Please sign in to comment.