[{"data":1,"prerenderedAt":117},["ShallowReactive",2],{"tool-content-en-docker-compose-converter":3},{"id":4,"title":5,"body":6,"description":107,"extension":108,"locale":109,"meta":110,"navigation":111,"path":112,"seo":113,"stem":114,"toolId":115,"__hash__":116},"tools\u002Ftools\u002Fen\u002Fdocker-compose-converter.md","Docker Run to Compose Converter",{"type":7,"value":8,"toc":100},"minimark",[9,14,34,38,83,87,97],[10,11,13],"h2",{"id":12},"from-docker-run-to-compose-and-back","From docker run to compose and back",[15,16,17,18,22,23,26,27,29,30,33],"p",{},"Paste a ",[19,20,21],"code",{},"docker run"," command and get an equivalent ",[19,24,25],{},"docker-compose.yml","; paste a compose file and get the matching ",[19,28,21],{}," command. Round-trips are lossless: converting a generated compose file back yields the same YAML. Shell tokenizing handles quotes, backslash line continuations, and ",[19,31,32],{},"$'...'"," quoting, so multi-line commands with quoted values parse correctly.",[10,35,37],{"id":36},"what-gets-recognized","What gets recognized",[15,39,40,41,44,45,48,49,52,53,57,58,61,62,65,66,69,70,48,73,48,76,79,80,82],{},"Ports (",[19,42,43],{},"-p","), volumes (",[19,46,47],{},"-v","\u002F",[19,50,51],{},"--mount",") with ",[54,55,56],"strong",{},"named-volume detection"," (bind mounts stay inline; named volumes get a top-level ",[19,59,60],{},"volumes:"," declaration), environment variables as a map (",[19,63,64],{},"${VAR}"," values preserved), env files, labels, ",[19,67,68],{},"container_name",", restart policy, networks with top-level declarations, user, working dir, hostname, memory and CPU limits, health checks, devices, capability flags, and the boolean trio ",[19,71,72],{},"-d",[19,74,75],{},"-it",[19,77,78],{},"--rm"," (mapped to compose semantics with a note for ",[19,81,78],{},"). Unknown or exotic flags are never silently dropped — they appear in a warning line above the output.",[10,84,86],{"id":85},"output","Output",[15,88,89,90,92,93,96],{},"The header strip summarizes the parse (image, port count, volume count). Output is live; Use as input keeps editing, and Copy\u002FDownload follow the usual result actions (",[19,91,25],{}," or ",[19,94,95],{},"run.sh",").",[15,98,99],{},"Parsing happens entirely in your browser — nothing is sent anywhere.",{"title":101,"searchDepth":102,"depth":102,"links":103},"",2,[104,105,106],{"id":12,"depth":102,"text":13},{"id":36,"depth":102,"text":37},{"id":85,"depth":102,"text":86},"Convert docker run commands to docker-compose.yml and back. Named-volume detection, shell tokenizing, and full round-trips — all local.","md","en",{},true,"\u002Ftools\u002Fen\u002Fdocker-compose-converter",{"title":5,"description":107},"tools\u002Fen\u002Fdocker-compose-converter","docker-compose-converter","ZPfgs_S-k1tOoDf_y0YBXoZrLSwEJtneAGX_2Js5AGc",1792391417343]