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