Skip to content

Commit ea43a8f

Browse files
authored
Merge pull request #70 from oslabs-beta/drew/header-finalized
Drew/header finalized
2 parents 47d7a02 + aab551e commit ea43a8f

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)