[{"data":1,"prerenderedAt":1480},["ShallowReactive",2],{"content-all-\u002Fdocker\u002Fdocker-dasar\u002Fdocker-execution":3,"related-\u002Fdocker\u002Fdocker-dasar\u002Fdocker-execution":1343,"sidebar-content":1455},[4],{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":9,"description":10,"tags":11,"date":15,"weight":16,"body":17,"_type":1337,"_id":1338,"_source":1339,"_file":1340,"_stem":1341,"_extension":1342},"\u002Fdocker\u002Fdocker-dasar\u002Fdocker-execution","docker-dasar",false,"","Docker Execution","Introduction to Docker execution and their usage",[12,13,14],"docker","devops","infrastructure","2026-03-12",22,{"type":18,"children":19,"toc":1332},"root",[20,29,44,50,64,138,143,175,188,193,324,329,376,388,392,944,950,963,1044,1048,1085,1106,1110,1130,1135,1189,1208,1212,1326],{"type":21,"tag":22,"props":23,"children":25},"element","h2",{"id":24},"prerequisites-running-a-docker-container",[26],{"type":27,"value":28},"text","Prerequisites - Running a Docker Container",{"type":21,"tag":30,"props":31,"children":32},"p",{},[33,35,42],{"type":27,"value":34},"Before you can execute a Docker container, you need to have Docker installed on your system. You can refer to the ",{"type":21,"tag":36,"props":37,"children":39},"a",{"href":38},".\u002Fdocker-container",[40],{"type":27,"value":41},"Docker Container",{"type":27,"value":43}," snippet for instructions on how to create and manage Docker containers.",{"type":21,"tag":22,"props":45,"children":47},{"id":46},"executing-a-command-in-a-running-container",[48],{"type":27,"value":49},"Executing a Command in a Running Container",{"type":21,"tag":30,"props":51,"children":52},{},[53,55,62],{"type":27,"value":54},"To execute a command inside a running Docker container, you can use the ",{"type":21,"tag":56,"props":57,"children":59},"code",{"className":58},[],[60],{"type":27,"value":61},"docker exec",{"type":27,"value":63}," command. This allows you to run a command in the context of the container, which can be useful for\ndebugging or performing administrative tasks.",{"type":21,"tag":65,"props":66,"children":70},"pre",{"className":67,"code":68,"language":69,"meta":8,"style":8},"language-bash shiki shiki-themes github-light github-dark","docker exec -it \u003Ccontainer-name> \u003Ccommand>\n","bash",[71],{"type":21,"tag":56,"props":72,"children":73},{"__ignoreMap":8},[74],{"type":21,"tag":75,"props":76,"children":79},"span",{"class":77,"line":78},"line",1,[80,85,91,97,103,108,114,119,123,128,133],{"type":21,"tag":75,"props":81,"children":83},{"style":82},"--shiki-default:#6F42C1;--shiki-dark:#B392F0",[84],{"type":27,"value":12},{"type":21,"tag":75,"props":86,"children":88},{"style":87},"--shiki-default:#032F62;--shiki-dark:#9ECBFF",[89],{"type":27,"value":90}," exec",{"type":21,"tag":75,"props":92,"children":94},{"style":93},"--shiki-default:#005CC5;--shiki-dark:#79B8FF",[95],{"type":27,"value":96}," -it",{"type":21,"tag":75,"props":98,"children":100},{"style":99},"--shiki-default:#D73A49;--shiki-dark:#F97583",[101],{"type":27,"value":102}," \u003C",{"type":21,"tag":75,"props":104,"children":105},{"style":87},[106],{"type":27,"value":107},"container-nam",{"type":21,"tag":75,"props":109,"children":111},{"style":110},"--shiki-default:#24292E;--shiki-dark:#E1E4E8",[112],{"type":27,"value":113},"e",{"type":21,"tag":75,"props":115,"children":116},{"style":99},[117],{"type":27,"value":118},">",{"type":21,"tag":75,"props":120,"children":121},{"style":99},[122],{"type":27,"value":102},{"type":21,"tag":75,"props":124,"children":125},{"style":87},[126],{"type":27,"value":127},"comman",{"type":21,"tag":75,"props":129,"children":130},{"style":110},[131],{"type":27,"value":132},"d",{"type":21,"tag":75,"props":134,"children":135},{"style":99},[136],{"type":27,"value":137},">\n",{"type":21,"tag":30,"props":139,"children":140},{},[141],{"type":27,"value":142},"Example:",{"type":21,"tag":65,"props":144,"children":146},{"className":67,"code":145,"language":69,"meta":8,"style":8},"docker exec -it my-nginx bash\n",[147],{"type":21,"tag":56,"props":148,"children":149},{"__ignoreMap":8},[150],{"type":21,"tag":75,"props":151,"children":152},{"class":77,"line":78},[153,157,161,165,170],{"type":21,"tag":75,"props":154,"children":155},{"style":82},[156],{"type":27,"value":12},{"type":21,"tag":75,"props":158,"children":159},{"style":87},[160],{"type":27,"value":90},{"type":21,"tag":75,"props":162,"children":163},{"style":93},[164],{"type":27,"value":96},{"type":21,"tag":75,"props":166,"children":167},{"style":87},[168],{"type":27,"value":169}," my-nginx",{"type":21,"tag":75,"props":171,"children":172},{"style":87},[173],{"type":27,"value":174}," bash\n",{"type":21,"tag":30,"props":176,"children":177},{},[178,180,186],{"type":27,"value":179},"This command will open an interactive terminal session inside the ",{"type":21,"tag":56,"props":181,"children":183},{"className":182},[],[184],{"type":27,"value":185},"my-nginx",{"type":27,"value":187}," container, allowing you to run commands as if you were logged into the container's shell.",{"type":21,"tag":30,"props":189,"children":190},{},[191],{"type":27,"value":192},"Output:",{"type":21,"tag":65,"props":194,"children":196},{"className":67,"code":195,"language":69,"meta":8,"style":8},"root@container-id:\u002F# \nroot@container-id:\u002F# ls\nbin  dev  etc  home  lib  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var\nroot@container-id:\u002F# \n",[197],{"type":21,"tag":56,"props":198,"children":199},{"__ignoreMap":8},[200,213,226,315],{"type":21,"tag":75,"props":201,"children":202},{"class":77,"line":78},[203,208],{"type":21,"tag":75,"props":204,"children":205},{"style":82},[206],{"type":27,"value":207},"root@container-id:\u002F#",{"type":21,"tag":75,"props":209,"children":210},{"style":110},[211],{"type":27,"value":212}," \n",{"type":21,"tag":75,"props":214,"children":216},{"class":77,"line":215},2,[217,221],{"type":21,"tag":75,"props":218,"children":219},{"style":82},[220],{"type":27,"value":207},{"type":21,"tag":75,"props":222,"children":223},{"style":87},[224],{"type":27,"value":225}," ls\n",{"type":21,"tag":75,"props":227,"children":229},{"class":77,"line":228},3,[230,235,240,245,250,255,260,265,270,275,280,285,290,295,300,305,310],{"type":21,"tag":75,"props":231,"children":232},{"style":82},[233],{"type":27,"value":234},"bin",{"type":21,"tag":75,"props":236,"children":237},{"style":87},[238],{"type":27,"value":239},"  dev",{"type":21,"tag":75,"props":241,"children":242},{"style":87},[243],{"type":27,"value":244},"  etc",{"type":21,"tag":75,"props":246,"children":247},{"style":87},[248],{"type":27,"value":249},"  home",{"type":21,"tag":75,"props":251,"children":252},{"style":87},[253],{"type":27,"value":254},"  lib",{"type":21,"tag":75,"props":256,"children":257},{"style":87},[258],{"type":27,"value":259},"  media",{"type":21,"tag":75,"props":261,"children":262},{"style":87},[263],{"type":27,"value":264},"  mnt",{"type":21,"tag":75,"props":266,"children":267},{"style":87},[268],{"type":27,"value":269},"  opt",{"type":21,"tag":75,"props":271,"children":272},{"style":87},[273],{"type":27,"value":274},"  proc",{"type":21,"tag":75,"props":276,"children":277},{"style":87},[278],{"type":27,"value":279},"  root",{"type":21,"tag":75,"props":281,"children":282},{"style":87},[283],{"type":27,"value":284},"  run",{"type":21,"tag":75,"props":286,"children":287},{"style":87},[288],{"type":27,"value":289},"  sbin",{"type":21,"tag":75,"props":291,"children":292},{"style":87},[293],{"type":27,"value":294},"  srv",{"type":21,"tag":75,"props":296,"children":297},{"style":87},[298],{"type":27,"value":299},"  sys",{"type":21,"tag":75,"props":301,"children":302},{"style":87},[303],{"type":27,"value":304},"  tmp",{"type":21,"tag":75,"props":306,"children":307},{"style":87},[308],{"type":27,"value":309},"  usr",{"type":21,"tag":75,"props":311,"children":312},{"style":87},[313],{"type":27,"value":314},"  var\n",{"type":21,"tag":75,"props":316,"children":318},{"class":77,"line":317},4,[319],{"type":21,"tag":75,"props":320,"children":321},{"style":82},[322],{"type":27,"value":323},"root@container-id:\u002F#\n",{"type":21,"tag":30,"props":325,"children":326},{},[327],{"type":27,"value":328},"You can also execute specific commands without opening an interactive terminal. For example, to check the status of the MySQL service inside a MySQL container, you can run:",{"type":21,"tag":65,"props":330,"children":332},{"className":67,"code":331,"language":69,"meta":8,"style":8},"docker exec -it my-mysql mysql -u root -p\n",[333],{"type":21,"tag":56,"props":334,"children":335},{"__ignoreMap":8},[336],{"type":21,"tag":75,"props":337,"children":338},{"class":77,"line":78},[339,343,347,351,356,361,366,371],{"type":21,"tag":75,"props":340,"children":341},{"style":82},[342],{"type":27,"value":12},{"type":21,"tag":75,"props":344,"children":345},{"style":87},[346],{"type":27,"value":90},{"type":21,"tag":75,"props":348,"children":349},{"style":93},[350],{"type":27,"value":96},{"type":21,"tag":75,"props":352,"children":353},{"style":87},[354],{"type":27,"value":355}," my-mysql",{"type":21,"tag":75,"props":357,"children":358},{"style":87},[359],{"type":27,"value":360}," mysql",{"type":21,"tag":75,"props":362,"children":363},{"style":93},[364],{"type":27,"value":365}," -u",{"type":21,"tag":75,"props":367,"children":368},{"style":87},[369],{"type":27,"value":370}," root",{"type":21,"tag":75,"props":372,"children":373},{"style":93},[374],{"type":27,"value":375}," -p\n",{"type":21,"tag":30,"props":377,"children":378},{},[379,380,386],{"type":27,"value":179},{"type":21,"tag":56,"props":381,"children":383},{"className":382},[],[384],{"type":27,"value":385},"my-mysql",{"type":27,"value":387}," container and start the MySQL client, allowing you to interact with the MySQL database running inside the container.",{"type":21,"tag":30,"props":389,"children":390},{},[391],{"type":27,"value":192},{"type":21,"tag":65,"props":393,"children":395},{"className":67,"code":394,"language":69,"meta":8,"style":8},"Enter password:\nWelcome to the MySQL monitor.  Commands end with ; or \\g.\nYour MySQL connection id is 1\nServer version: 5.7.34 MySQL Community Server (GPL)\nCopyright (c) 2000, 2021, Oracle and\u002For its affiliates. All rights reserved.\nOracle is a registered trademark of Oracle Corporation and\u002For its affiliates. Other names may be trademarks of their respective owners.\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\nmysql> \nmysql> SHOW DATABASES;\n+--------------------+\n| Database           |\n+--------------------+\n| information_schema |\n| mysql              |\n| performance_schema | \n| sys                |\n+--------------------+\n4 rows in set (0.00 sec)\nmysql>\n",[396],{"type":21,"tag":56,"props":397,"children":398},{"__ignoreMap":8},[399,412,475,507,544,558,660,732,746,774,783,802,810,828,845,867,885,893,932],{"type":21,"tag":75,"props":400,"children":401},{"class":77,"line":78},[402,407],{"type":21,"tag":75,"props":403,"children":404},{"style":82},[405],{"type":27,"value":406},"Enter",{"type":21,"tag":75,"props":408,"children":409},{"style":87},[410],{"type":27,"value":411}," password:\n",{"type":21,"tag":75,"props":413,"children":414},{"class":77,"line":215},[415,420,425,430,435,440,445,450,455,460,465,470],{"type":21,"tag":75,"props":416,"children":417},{"style":82},[418],{"type":27,"value":419},"Welcome",{"type":21,"tag":75,"props":421,"children":422},{"style":87},[423],{"type":27,"value":424}," to",{"type":21,"tag":75,"props":426,"children":427},{"style":87},[428],{"type":27,"value":429}," the",{"type":21,"tag":75,"props":431,"children":432},{"style":87},[433],{"type":27,"value":434}," MySQL",{"type":21,"tag":75,"props":436,"children":437},{"style":87},[438],{"type":27,"value":439}," monitor.",{"type":21,"tag":75,"props":441,"children":442},{"style":87},[443],{"type":27,"value":444},"  Commands",{"type":21,"tag":75,"props":446,"children":447},{"style":87},[448],{"type":27,"value":449}," end",{"type":21,"tag":75,"props":451,"children":452},{"style":87},[453],{"type":27,"value":454}," with",{"type":21,"tag":75,"props":456,"children":457},{"style":110},[458],{"type":27,"value":459}," ; ",{"type":21,"tag":75,"props":461,"children":462},{"style":82},[463],{"type":27,"value":464},"or",{"type":21,"tag":75,"props":466,"children":467},{"style":93},[468],{"type":27,"value":469}," \\g",{"type":21,"tag":75,"props":471,"children":472},{"style":87},[473],{"type":27,"value":474},".\n",{"type":21,"tag":75,"props":476,"children":477},{"class":77,"line":228},[478,483,487,492,497,502],{"type":21,"tag":75,"props":479,"children":480},{"style":82},[481],{"type":27,"value":482},"Your",{"type":21,"tag":75,"props":484,"children":485},{"style":87},[486],{"type":27,"value":434},{"type":21,"tag":75,"props":488,"children":489},{"style":87},[490],{"type":27,"value":491}," connection",{"type":21,"tag":75,"props":493,"children":494},{"style":87},[495],{"type":27,"value":496}," id",{"type":21,"tag":75,"props":498,"children":499},{"style":87},[500],{"type":27,"value":501}," is",{"type":21,"tag":75,"props":503,"children":504},{"style":93},[505],{"type":27,"value":506}," 1\n",{"type":21,"tag":75,"props":508,"children":509},{"class":77,"line":317},[510,515,520,525,529,534,539],{"type":21,"tag":75,"props":511,"children":512},{"style":82},[513],{"type":27,"value":514},"Server",{"type":21,"tag":75,"props":516,"children":517},{"style":87},[518],{"type":27,"value":519}," version:",{"type":21,"tag":75,"props":521,"children":522},{"style":93},[523],{"type":27,"value":524}," 5.7.34",{"type":21,"tag":75,"props":526,"children":527},{"style":87},[528],{"type":27,"value":434},{"type":21,"tag":75,"props":530,"children":531},{"style":87},[532],{"type":27,"value":533}," Community",{"type":21,"tag":75,"props":535,"children":536},{"style":87},[537],{"type":27,"value":538}," Server",{"type":21,"tag":75,"props":540,"children":541},{"style":110},[542],{"type":27,"value":543}," (GPL)\n",{"type":21,"tag":75,"props":545,"children":547},{"class":77,"line":546},5,[548,553],{"type":21,"tag":75,"props":549,"children":550},{"style":82},[551],{"type":27,"value":552},"Copyright",{"type":21,"tag":75,"props":554,"children":555},{"style":110},[556],{"type":27,"value":557}," (c) 2000, 2021, Oracle and\u002For its affiliates. All rights reserved.\n",{"type":21,"tag":75,"props":559,"children":561},{"class":77,"line":560},6,[562,567,571,576,581,586,591,596,601,606,611,616,621,626,631,636,641,645,650,655],{"type":21,"tag":75,"props":563,"children":564},{"style":82},[565],{"type":27,"value":566},"Oracle",{"type":21,"tag":75,"props":568,"children":569},{"style":87},[570],{"type":27,"value":501},{"type":21,"tag":75,"props":572,"children":573},{"style":87},[574],{"type":27,"value":575}," a",{"type":21,"tag":75,"props":577,"children":578},{"style":87},[579],{"type":27,"value":580}," registered",{"type":21,"tag":75,"props":582,"children":583},{"style":87},[584],{"type":27,"value":585}," trademark",{"type":21,"tag":75,"props":587,"children":588},{"style":87},[589],{"type":27,"value":590}," of",{"type":21,"tag":75,"props":592,"children":593},{"style":87},[594],{"type":27,"value":595}," Oracle",{"type":21,"tag":75,"props":597,"children":598},{"style":87},[599],{"type":27,"value":600}," Corporation",{"type":21,"tag":75,"props":602,"children":603},{"style":87},[604],{"type":27,"value":605}," and\u002For",{"type":21,"tag":75,"props":607,"children":608},{"style":87},[609],{"type":27,"value":610}," its",{"type":21,"tag":75,"props":612,"children":613},{"style":87},[614],{"type":27,"value":615}," affiliates.",{"type":21,"tag":75,"props":617,"children":618},{"style":87},[619],{"type":27,"value":620}," Other",{"type":21,"tag":75,"props":622,"children":623},{"style":87},[624],{"type":27,"value":625}," names",{"type":21,"tag":75,"props":627,"children":628},{"style":87},[629],{"type":27,"value":630}," may",{"type":21,"tag":75,"props":632,"children":633},{"style":87},[634],{"type":27,"value":635}," be",{"type":21,"tag":75,"props":637,"children":638},{"style":87},[639],{"type":27,"value":640}," trademarks",{"type":21,"tag":75,"props":642,"children":643},{"style":87},[644],{"type":27,"value":590},{"type":21,"tag":75,"props":646,"children":647},{"style":87},[648],{"type":27,"value":649}," their",{"type":21,"tag":75,"props":651,"children":652},{"style":87},[653],{"type":27,"value":654}," respective",{"type":21,"tag":75,"props":656,"children":657},{"style":87},[658],{"type":27,"value":659}," owners.\n",{"type":21,"tag":75,"props":661,"children":663},{"class":77,"line":662},7,[664,669,674,679,684,689,694,699,704,708,713,717,722,727],{"type":21,"tag":75,"props":665,"children":666},{"style":82},[667],{"type":27,"value":668},"Type",{"type":21,"tag":75,"props":670,"children":671},{"style":87},[672],{"type":27,"value":673}," 'help;'",{"type":21,"tag":75,"props":675,"children":676},{"style":87},[677],{"type":27,"value":678}," or",{"type":21,"tag":75,"props":680,"children":681},{"style":87},[682],{"type":27,"value":683}," '\\h'",{"type":21,"tag":75,"props":685,"children":686},{"style":87},[687],{"type":27,"value":688}," for",{"type":21,"tag":75,"props":690,"children":691},{"style":87},[692],{"type":27,"value":693}," help.",{"type":21,"tag":75,"props":695,"children":696},{"style":87},[697],{"type":27,"value":698}," Type",{"type":21,"tag":75,"props":700,"children":701},{"style":87},[702],{"type":27,"value":703}," '\\c'",{"type":21,"tag":75,"props":705,"children":706},{"style":87},[707],{"type":27,"value":424},{"type":21,"tag":75,"props":709,"children":710},{"style":87},[711],{"type":27,"value":712}," clear",{"type":21,"tag":75,"props":714,"children":715},{"style":87},[716],{"type":27,"value":429},{"type":21,"tag":75,"props":718,"children":719},{"style":87},[720],{"type":27,"value":721}," current",{"type":21,"tag":75,"props":723,"children":724},{"style":87},[725],{"type":27,"value":726}," input",{"type":21,"tag":75,"props":728,"children":729},{"style":87},[730],{"type":27,"value":731}," statement.\n",{"type":21,"tag":75,"props":733,"children":735},{"class":77,"line":734},8,[736,741],{"type":21,"tag":75,"props":737,"children":738},{"style":82},[739],{"type":27,"value":740},"mysql",{"type":21,"tag":75,"props":742,"children":743},{"style":110},[744],{"type":27,"value":745},"> \n",{"type":21,"tag":75,"props":747,"children":749},{"class":77,"line":748},9,[750,754,759,764,769],{"type":21,"tag":75,"props":751,"children":752},{"style":82},[753],{"type":27,"value":740},{"type":21,"tag":75,"props":755,"children":756},{"style":110},[757],{"type":27,"value":758},"> ",{"type":21,"tag":75,"props":760,"children":761},{"style":87},[762],{"type":27,"value":763},"SHOW",{"type":21,"tag":75,"props":765,"children":766},{"style":87},[767],{"type":27,"value":768}," DATABASES",{"type":21,"tag":75,"props":770,"children":771},{"style":110},[772],{"type":27,"value":773},";\n",{"type":21,"tag":75,"props":775,"children":777},{"class":77,"line":776},10,[778],{"type":21,"tag":75,"props":779,"children":780},{"style":82},[781],{"type":27,"value":782},"+--------------------+\n",{"type":21,"tag":75,"props":784,"children":786},{"class":77,"line":785},11,[787,792,797],{"type":21,"tag":75,"props":788,"children":789},{"style":99},[790],{"type":27,"value":791},"|",{"type":21,"tag":75,"props":793,"children":794},{"style":82},[795],{"type":27,"value":796}," Database",{"type":21,"tag":75,"props":798,"children":799},{"style":99},[800],{"type":27,"value":801},"           |\n",{"type":21,"tag":75,"props":803,"children":805},{"class":77,"line":804},12,[806],{"type":21,"tag":75,"props":807,"children":808},{"style":82},[809],{"type":27,"value":782},{"type":21,"tag":75,"props":811,"children":813},{"class":77,"line":812},13,[814,818,823],{"type":21,"tag":75,"props":815,"children":816},{"style":99},[817],{"type":27,"value":791},{"type":21,"tag":75,"props":819,"children":820},{"style":82},[821],{"type":27,"value":822}," information_schema",{"type":21,"tag":75,"props":824,"children":825},{"style":99},[826],{"type":27,"value":827}," |\n",{"type":21,"tag":75,"props":829,"children":831},{"class":77,"line":830},14,[832,836,840],{"type":21,"tag":75,"props":833,"children":834},{"style":99},[835],{"type":27,"value":791},{"type":21,"tag":75,"props":837,"children":838},{"style":82},[839],{"type":27,"value":360},{"type":21,"tag":75,"props":841,"children":842},{"style":99},[843],{"type":27,"value":844},"              |\n",{"type":21,"tag":75,"props":846,"children":848},{"class":77,"line":847},15,[849,853,858,863],{"type":21,"tag":75,"props":850,"children":851},{"style":99},[852],{"type":27,"value":791},{"type":21,"tag":75,"props":854,"children":855},{"style":82},[856],{"type":27,"value":857}," performance_schema",{"type":21,"tag":75,"props":859,"children":860},{"style":99},[861],{"type":27,"value":862}," |",{"type":21,"tag":75,"props":864,"children":865},{"style":110},[866],{"type":27,"value":212},{"type":21,"tag":75,"props":868,"children":870},{"class":77,"line":869},16,[871,875,880],{"type":21,"tag":75,"props":872,"children":873},{"style":99},[874],{"type":27,"value":791},{"type":21,"tag":75,"props":876,"children":877},{"style":82},[878],{"type":27,"value":879}," sys",{"type":21,"tag":75,"props":881,"children":882},{"style":99},[883],{"type":27,"value":884},"                |\n",{"type":21,"tag":75,"props":886,"children":888},{"class":77,"line":887},17,[889],{"type":21,"tag":75,"props":890,"children":891},{"style":82},[892],{"type":27,"value":782},{"type":21,"tag":75,"props":894,"children":896},{"class":77,"line":895},18,[897,902,907,912,917,922,927],{"type":21,"tag":75,"props":898,"children":899},{"style":82},[900],{"type":27,"value":901},"4",{"type":21,"tag":75,"props":903,"children":904},{"style":87},[905],{"type":27,"value":906}," rows",{"type":21,"tag":75,"props":908,"children":909},{"style":87},[910],{"type":27,"value":911}," in",{"type":21,"tag":75,"props":913,"children":914},{"style":87},[915],{"type":27,"value":916}," set",{"type":21,"tag":75,"props":918,"children":919},{"style":110},[920],{"type":27,"value":921}," (0.00 ",{"type":21,"tag":75,"props":923,"children":924},{"style":87},[925],{"type":27,"value":926},"sec",{"type":21,"tag":75,"props":928,"children":929},{"style":110},[930],{"type":27,"value":931},")\n",{"type":21,"tag":75,"props":933,"children":935},{"class":77,"line":934},19,[936,940],{"type":21,"tag":75,"props":937,"children":938},{"style":82},[939],{"type":27,"value":740},{"type":21,"tag":75,"props":941,"children":942},{"style":110},[943],{"type":27,"value":137},{"type":21,"tag":22,"props":945,"children":947},{"id":946},"executing-a-command-in-a-new-container",[948],{"type":27,"value":949},"Executing a Command in a New Container",{"type":21,"tag":30,"props":951,"children":952},{},[953,955,961],{"type":27,"value":954},"You can also execute a command in a new container using the ",{"type":21,"tag":56,"props":956,"children":958},{"className":957},[],[959],{"type":27,"value":960},"docker run",{"type":27,"value":962}," command. This will create a new container from a specified image and execute the command in that container.",{"type":21,"tag":65,"props":964,"children":966},{"className":67,"code":965,"language":69,"meta":8,"style":8},"docker run --rm \u003Cimage-name>:\u003Ctag> \u003Ccommand>\n",[967],{"type":21,"tag":56,"props":968,"children":969},{"__ignoreMap":8},[970],{"type":21,"tag":75,"props":971,"children":972},{"class":77,"line":78},[973,977,982,987,991,996,1000,1004,1009,1014,1019,1024,1028,1032,1036,1040],{"type":21,"tag":75,"props":974,"children":975},{"style":82},[976],{"type":27,"value":12},{"type":21,"tag":75,"props":978,"children":979},{"style":87},[980],{"type":27,"value":981}," run",{"type":21,"tag":75,"props":983,"children":984},{"style":93},[985],{"type":27,"value":986}," --rm",{"type":21,"tag":75,"props":988,"children":989},{"style":99},[990],{"type":27,"value":102},{"type":21,"tag":75,"props":992,"children":993},{"style":87},[994],{"type":27,"value":995},"image-nam",{"type":21,"tag":75,"props":997,"children":998},{"style":110},[999],{"type":27,"value":113},{"type":21,"tag":75,"props":1001,"children":1002},{"style":99},[1003],{"type":27,"value":118},{"type":21,"tag":75,"props":1005,"children":1006},{"style":87},[1007],{"type":27,"value":1008},":",{"type":21,"tag":75,"props":1010,"children":1011},{"style":99},[1012],{"type":27,"value":1013},"\u003C",{"type":21,"tag":75,"props":1015,"children":1016},{"style":87},[1017],{"type":27,"value":1018},"ta",{"type":21,"tag":75,"props":1020,"children":1021},{"style":110},[1022],{"type":27,"value":1023},"g",{"type":21,"tag":75,"props":1025,"children":1026},{"style":99},[1027],{"type":27,"value":118},{"type":21,"tag":75,"props":1029,"children":1030},{"style":99},[1031],{"type":27,"value":102},{"type":21,"tag":75,"props":1033,"children":1034},{"style":87},[1035],{"type":27,"value":127},{"type":21,"tag":75,"props":1037,"children":1038},{"style":110},[1039],{"type":27,"value":132},{"type":21,"tag":75,"props":1041,"children":1042},{"style":99},[1043],{"type":27,"value":137},{"type":21,"tag":30,"props":1045,"children":1046},{},[1047],{"type":27,"value":142},{"type":21,"tag":65,"props":1049,"children":1051},{"className":67,"code":1050,"language":69,"meta":8,"style":8},"docker run --rm nginx:latest echo \"Hello, World!\"\n",[1052],{"type":21,"tag":56,"props":1053,"children":1054},{"__ignoreMap":8},[1055],{"type":21,"tag":75,"props":1056,"children":1057},{"class":77,"line":78},[1058,1062,1066,1070,1075,1080],{"type":21,"tag":75,"props":1059,"children":1060},{"style":82},[1061],{"type":27,"value":12},{"type":21,"tag":75,"props":1063,"children":1064},{"style":87},[1065],{"type":27,"value":981},{"type":21,"tag":75,"props":1067,"children":1068},{"style":93},[1069],{"type":27,"value":986},{"type":21,"tag":75,"props":1071,"children":1072},{"style":87},[1073],{"type":27,"value":1074}," nginx:latest",{"type":21,"tag":75,"props":1076,"children":1077},{"style":87},[1078],{"type":27,"value":1079}," echo",{"type":21,"tag":75,"props":1081,"children":1082},{"style":87},[1083],{"type":27,"value":1084}," \"Hello, World!\"\n",{"type":21,"tag":30,"props":1086,"children":1087},{},[1088,1090,1096,1098,1104],{"type":27,"value":1089},"This command will create a new container from the ",{"type":21,"tag":56,"props":1091,"children":1093},{"className":1092},[],[1094],{"type":27,"value":1095},"nginx:latest",{"type":27,"value":1097}," image, execute the ",{"type":21,"tag":56,"props":1099,"children":1101},{"className":1100},[],[1102],{"type":27,"value":1103},"echo \"Hello, World!\"",{"type":27,"value":1105}," command, and then remove the container after the command has finished executing.",{"type":21,"tag":30,"props":1107,"children":1108},{},[1109],{"type":27,"value":192},{"type":21,"tag":65,"props":1111,"children":1113},{"className":67,"code":1112,"language":69,"meta":8,"style":8},"Hello, World!\n",[1114],{"type":21,"tag":56,"props":1115,"children":1116},{"__ignoreMap":8},[1117],{"type":21,"tag":75,"props":1118,"children":1119},{"class":77,"line":78},[1120,1125],{"type":21,"tag":75,"props":1121,"children":1122},{"style":82},[1123],{"type":27,"value":1124},"Hello,",{"type":21,"tag":75,"props":1126,"children":1127},{"style":87},[1128],{"type":27,"value":1129}," World!\n",{"type":21,"tag":30,"props":1131,"children":1132},{},[1133],{"type":27,"value":1134},"Another example with MySQL:",{"type":21,"tag":65,"props":1136,"children":1138},{"className":67,"code":1137,"language":69,"meta":8,"style":8},"docker run --rm mysql:5.7 mysql -u root -p -e \"SHOW DATABASES;\"\n",[1139],{"type":21,"tag":56,"props":1140,"children":1141},{"__ignoreMap":8},[1142],{"type":21,"tag":75,"props":1143,"children":1144},{"class":77,"line":78},[1145,1149,1153,1157,1162,1166,1170,1174,1179,1184],{"type":21,"tag":75,"props":1146,"children":1147},{"style":82},[1148],{"type":27,"value":12},{"type":21,"tag":75,"props":1150,"children":1151},{"style":87},[1152],{"type":27,"value":981},{"type":21,"tag":75,"props":1154,"children":1155},{"style":93},[1156],{"type":27,"value":986},{"type":21,"tag":75,"props":1158,"children":1159},{"style":87},[1160],{"type":27,"value":1161}," mysql:5.7",{"type":21,"tag":75,"props":1163,"children":1164},{"style":87},[1165],{"type":27,"value":360},{"type":21,"tag":75,"props":1167,"children":1168},{"style":93},[1169],{"type":27,"value":365},{"type":21,"tag":75,"props":1171,"children":1172},{"style":87},[1173],{"type":27,"value":370},{"type":21,"tag":75,"props":1175,"children":1176},{"style":93},[1177],{"type":27,"value":1178}," -p",{"type":21,"tag":75,"props":1180,"children":1181},{"style":93},[1182],{"type":27,"value":1183}," -e",{"type":21,"tag":75,"props":1185,"children":1186},{"style":87},[1187],{"type":27,"value":1188}," \"SHOW DATABASES;\"\n",{"type":21,"tag":30,"props":1190,"children":1191},{},[1192,1193,1199,1201,1207],{"type":27,"value":1089},{"type":21,"tag":56,"props":1194,"children":1196},{"className":1195},[],[1197],{"type":27,"value":1198},"mysql:5.7",{"type":27,"value":1200}," image, execute the MySQL client with the ",{"type":21,"tag":56,"props":1202,"children":1204},{"className":1203},[],[1205],{"type":27,"value":1206},"SHOW DATABASES;",{"type":27,"value":1105},{"type":21,"tag":30,"props":1209,"children":1210},{},[1211],{"type":27,"value":192},{"type":21,"tag":65,"props":1213,"children":1215},{"className":67,"code":1214,"language":69,"meta":8,"style":8},"Enter password:\n+--------------------+\n| Database           |\n+--------------------+\n| information_schema |\n| mysql              |\n| performance_schema |\n| sys                |\n+--------------------+\n",[1216],{"type":21,"tag":56,"props":1217,"children":1218},{"__ignoreMap":8},[1219,1230,1237,1252,1259,1274,1289,1304,1319],{"type":21,"tag":75,"props":1220,"children":1221},{"class":77,"line":78},[1222,1226],{"type":21,"tag":75,"props":1223,"children":1224},{"style":82},[1225],{"type":27,"value":406},{"type":21,"tag":75,"props":1227,"children":1228},{"style":87},[1229],{"type":27,"value":411},{"type":21,"tag":75,"props":1231,"children":1232},{"class":77,"line":215},[1233],{"type":21,"tag":75,"props":1234,"children":1235},{"style":82},[1236],{"type":27,"value":782},{"type":21,"tag":75,"props":1238,"children":1239},{"class":77,"line":228},[1240,1244,1248],{"type":21,"tag":75,"props":1241,"children":1242},{"style":99},[1243],{"type":27,"value":791},{"type":21,"tag":75,"props":1245,"children":1246},{"style":82},[1247],{"type":27,"value":796},{"type":21,"tag":75,"props":1249,"children":1250},{"style":99},[1251],{"type":27,"value":801},{"type":21,"tag":75,"props":1253,"children":1254},{"class":77,"line":317},[1255],{"type":21,"tag":75,"props":1256,"children":1257},{"style":82},[1258],{"type":27,"value":782},{"type":21,"tag":75,"props":1260,"children":1261},{"class":77,"line":546},[1262,1266,1270],{"type":21,"tag":75,"props":1263,"children":1264},{"style":99},[1265],{"type":27,"value":791},{"type":21,"tag":75,"props":1267,"children":1268},{"style":82},[1269],{"type":27,"value":822},{"type":21,"tag":75,"props":1271,"children":1272},{"style":99},[1273],{"type":27,"value":827},{"type":21,"tag":75,"props":1275,"children":1276},{"class":77,"line":560},[1277,1281,1285],{"type":21,"tag":75,"props":1278,"children":1279},{"style":99},[1280],{"type":27,"value":791},{"type":21,"tag":75,"props":1282,"children":1283},{"style":82},[1284],{"type":27,"value":360},{"type":21,"tag":75,"props":1286,"children":1287},{"style":99},[1288],{"type":27,"value":844},{"type":21,"tag":75,"props":1290,"children":1291},{"class":77,"line":662},[1292,1296,1300],{"type":21,"tag":75,"props":1293,"children":1294},{"style":99},[1295],{"type":27,"value":791},{"type":21,"tag":75,"props":1297,"children":1298},{"style":82},[1299],{"type":27,"value":857},{"type":21,"tag":75,"props":1301,"children":1302},{"style":99},[1303],{"type":27,"value":827},{"type":21,"tag":75,"props":1305,"children":1306},{"class":77,"line":734},[1307,1311,1315],{"type":21,"tag":75,"props":1308,"children":1309},{"style":99},[1310],{"type":27,"value":791},{"type":21,"tag":75,"props":1312,"children":1313},{"style":82},[1314],{"type":27,"value":879},{"type":21,"tag":75,"props":1316,"children":1317},{"style":99},[1318],{"type":27,"value":884},{"type":21,"tag":75,"props":1320,"children":1321},{"class":77,"line":748},[1322],{"type":21,"tag":75,"props":1323,"children":1324},{"style":82},[1325],{"type":27,"value":782},{"type":21,"tag":1327,"props":1328,"children":1329},"style",{},[1330],{"type":27,"value":1331},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":8,"searchDepth":228,"depth":228,"links":1333},[1334,1335,1336],{"id":24,"depth":215,"text":28},{"id":46,"depth":215,"text":49},{"id":946,"depth":215,"text":949},"markdown","content:docker:docker-dasar:docker-execution.md","content","docker\u002Fdocker-dasar\u002Fdocker-execution.md","docker\u002Fdocker-dasar\u002Fdocker-execution","md",[1344,1353,1358,1364,1373,1378,1383,1388,1393,1398,1404,1408,1413,1418,1423,1428,1436,1442,1449],{"_path":1345,"title":1346,"description":1347,"tags":1348,"date":1352},"\u002Fdata-structure-algorithm\u002Farray-manipulation\u002Ffor-looping","For Looping in Python","Using for loops to manipulate arrays in Python.",[1349,1350,1351],"python","backend","arrays","2026-03-18",{"_path":1354,"title":1355,"description":1356,"tags":1357,"date":1352},"\u002Fdata-structure-algorithm\u002Farray-manipulation\u002Fwhile-looping","While Looping in Python","Using while loops to manipulate arrays in Python.",[1349,1350,1351],{"_path":1359,"title":1360,"description":1361,"tags":1362,"date":1363},"\u002Fdata-structure-algorithm\u002Fassignments","Assignments","Assignments in Python for competitive programming.",[1349,1350],"2026-04-10",{"_path":1365,"title":1366,"description":1367,"tags":1368,"date":1372},"\u002Fdata-structure-algorithm\u002Fbuzzword","Buzzword List DSA","Common terms and concepts in data structures and algorithms.",[1369,1370,1371],"dsa","algorithms","data-structures","2026-04-03",{"_path":1374,"title":1375,"description":1376,"tags":1377,"date":1363},"\u002Fdata-structure-algorithm\u002Fdata-type","Data Types","Data types in Python for competitive programming.",[1349,1350],{"_path":1379,"title":1380,"description":1381,"tags":1382,"date":1363},"\u002Fdata-structure-algorithm\u002Fhash-map","Hash Map","Hash map implementation in Python for competitive programming.",[1349,1350],{"_path":1384,"title":1385,"description":1386,"tags":1387,"date":1363},"\u002Fdata-structure-algorithm\u002Finput-output","Input and Output","Handling input and output in Python for competitive programming.",[1349,1350],{"_path":1389,"title":1390,"description":1391,"tags":1392,"date":1352},"\u002Fdata-structure-algorithm\u002Fmath-library\u002Fsum","Sum Elements","Using for loops to sum elements in Python.",[1349,1350,1351],{"_path":1394,"title":1395,"description":1396,"tags":1397,"date":1352},"\u002Fdata-structure-algorithm\u002Fmath-library\u002Fsummary","Summary","Summary of the math library in Python.",[1349,1350,1351],{"_path":1399,"title":1400,"description":1401,"tags":1402,"date":1403},"\u002Fdocker\u002Fcheat-sheets","Docker Cheat Sheets","Cheat sheets for frequently used Docker commands and concepts",[12,13,14],"2026-05-01",{"_path":1405,"title":41,"description":1406,"tags":1407,"date":15},"\u002Fdocker\u002Fdocker-dasar\u002Fdocker-container","Introduction to Docker containers and their usage",[12,13,14],{"_path":1409,"title":1410,"description":1411,"tags":1412,"date":15},"\u002Fdocker\u002Fdocker-dasar\u002Fdocker-image","Docker Image","Introduction to Docker images and their usage",[12,13,14],{"_path":1414,"title":1415,"description":1416,"tags":1417,"date":15},"\u002Fdocker\u002Fdocker-dasar\u002Fdocker-logging","Docker Logging","Introduction to Docker logging and their usage",[12,13,14],{"_path":1419,"title":1420,"description":1421,"tags":1422,"date":15},"\u002Fdocker\u002Fdocker-prerequisites\u002Fdocker-installation","Docker Installation","Introduction to Docker installation and their usage",[12,13,14],{"_path":1424,"title":1425,"description":1426,"tags":1427,"date":15},"\u002Fdocker\u002Fresources","Docker Resources","Collection of Docker resources for learning and reference",[12,13,14],{"_path":1429,"title":1430,"description":1431,"tags":1432,"date":15},"\u002Fjavascript\u002Fpromises","Promise Patterns","Common JavaScript promise patterns and async\u002Fawait usage",[1433,1434,1435],"javascript","frontend","async",{"_path":1437,"title":1438,"description":1439,"tags":1440,"date":1352},"\u002Fphp\u002Farrays","PHP Array Functions","Essential PHP array functions and patterns",[1441,1350,1351],"php",{"_path":1443,"title":1444,"description":1445,"tags":1446,"date":1448},"\u002Fphp\u002Fpatterns\u002Fsingleton","Singleton Pattern","Implementing the singleton pattern in PHP",[1441,1447,1350],"patterns","2026-03-13",{"_path":1450,"title":1451,"description":1452,"tags":1453,"date":1454},"\u002Fphp\u002Freferences","PHP References (&)","Useful PHP reference snippets and patterns",[1441,1350],"2026-03-19",[1456,1457,1458,1459,1460,1461,1462,1463,1465,1466,1468,1469,1470,1472,1474,1475,1476,1477,1478,1479],{"_path":1345,"title":1346,"weight":776},{"_path":1354,"title":1355,"weight":776},{"_path":1359,"title":1360,"weight":228},{"_path":1365,"title":1366,"weight":78},{"_path":1374,"title":1375,"weight":215},{"_path":1379,"title":1380,"weight":776},{"_path":1384,"title":1385,"weight":78},{"_path":1389,"title":1390,"weight":1464},20,{"_path":1394,"title":1395,"weight":776},{"_path":1399,"title":1400,"weight":1467},100,{"_path":1405,"title":41,"weight":1464},{"_path":5,"title":9,"weight":16},{"_path":1409,"title":1410,"weight":1471},21,{"_path":1414,"title":1415,"weight":1473},23,{"_path":1419,"title":1420,"weight":776},{"_path":1424,"title":1425,"weight":78},{"_path":1429,"title":1430},{"_path":1437,"title":1438,"weight":78},{"_path":1443,"title":1444},{"_path":1450,"title":1451,"weight":215},1777825383526]