Skip to content

Commit aecc1ea

Browse files
DrewManleySbethmtiffanynchaujackyuan1CedarCooper
committed
container ID added
Co-authored-by: Sarah Moosa <[email protected]> Co-authored-by: Tiffany Chau <[email protected]> Co-authored-by: Jack Yuan <[email protected]> Co-authored-by: Cedar Cooper <[email protected]>
1 parent 282b57a commit aecc1ea

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/helper/commands.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,11 @@ export const runStopped = (
242242
export const runIm = (container, runningList, callback_1, callback_2) => {
243243
// props.runIm(ele['imgid'], props.runningList, helper.addRunning, props.addRunningContainers)
244244
const { imgid, reps, tag } = container;
245-
window.nodeMethod.runExec(`docker run --name ${reps}-${tag} ${reps}:${tag}`, (error, stdout, stderr) => {
245+
const containerId = Math.floor(Math.random() * 100)
246+
const filteredRepo = reps
247+
.replace(/[,\/#!$%\^&\*;:{}=\`~()]/g, ".")
248+
.replace(/\s{2,}/g, " ");
249+
window.nodeMethod.runExec(`docker run --name ${filteredRepo}-${tag}_${containerId} ${reps}:${tag}`, (error, stdout, stderr) => {
246250
if (error) {
247251
alert(`${error.message}`);
248252
return;

0 commit comments

Comments
 (0)