[{"data":1,"prerenderedAt":281},["ShallowReactive",2],{"project-11163639":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":28,"sentiment":29,"stance_mix":30,"scored_comments":34,"aspects":35,"strip":43,"post_text":45,"what":46,"said":81,"maker_in_thread":167,"shape":176,"grid":180,"attempts":244,"same_week":245,"maker_shows":44,"maker_hidden":273,"reader_version":274,"card":275},"11163639","sidomo","Import Docker in Python and Run Anything","title","Show HN: Import Docker in Python and Run Anything","http:\u002F\u002Fblog.deepgram.com\u002Fimport-a-docker-container-in-python\u002F","blog.deepgram.com","stephensonsco",1456274980,2016,142,29,243,2264,11,"notable","dev_tools","container wrapper library","library",[24,25,26,27],"docker","python","containers","docker-py","mixed",0.105,{"positive":31,"neutral":31,"mixed":32,"critical":33},9,0,3,21,{"idea":36,"execution":38,"privacy":40,"design":41},{"positive":37,"critical":33},6,{"positive":39,"critical":32},2,{"positive":32,"critical":32},{"positive":42,"critical":32},1,[32,32,32,32,32,32,33,32,44,44,42,33,33,42,42,44,44,44,33,44,44,33,33,33,33,44,32,33,44],5,null,{"problem":47,"audience":54,"pricing":45,"motivation":67,"time_to_build":45,"stack":71,"openness":80,"stage":80,"team_size":80},{"value":48,"source":49,"evidence":50},"Running complicated non-Python code and environment-heavy tools from Python","maker",[51],{"id":52,"by":11,"text":53},"11163668","We made a python module to run complicated non-python code in python (like stuff that needs ridiculous environmental gymnastics). It's called sidomo (Simple Docker Module) and…",{"value":55,"source":56,"evidence":57},"Python developers who need to run containerized tools","inferred",[58,59,63],{"id":52,"by":11,"text":53},{"id":60,"by":61,"text":62},"11164177","sciencerobot","I've been looking for something like this. My use case is that I have a bunch of really old bioinformatics programs that are a pain to install and I want to run them from a web…",{"id":64,"by":65,"text":66},"11164053","noajshu","Absolutely, we use it especially because our servers are linux and our personal machines are mac. Most of our app is not containerized but sidomo helps us make the 'fiddly bits'…",{"value":68,"source":49,"evidence":69},"Make non-Python code easy to run from Python",[70],{"id":52,"by":11,"text":53},[72,76],{"value":73,"source":49,"evidence":74},"Python",[75],{"id":52,"by":11,"text":53},{"value":77,"source":49,"evidence":78},"Docker",[79],{"id":52,"by":11,"text":53},"unknown",{"praise":82,"objections":100,"requests":126,"questions":134,"alternatives":149},[83,96],{"value":84,"source":85,"evidence":86},"Useful for testing and portable fiddly dependencies like ffmpeg","commenter",[87,91,92],{"id":88,"by":89,"text":90},"11163988","rco8786","I can see it being useful for building up a testing environment\u002Fframework",{"id":64,"by":65,"text":66},{"id":93,"by":94,"text":95},"11164630","kanzure","Hmm, this could be a good way to use postgresql during unit tests for python applications, as a cheap alternative to sqlite:\u002F\u002F:memory: and ramdisks. Cleanup is just container…",{"value":97,"source":85,"evidence":98},"Solves installing old bioinformatics tools",[99],{"id":60,"by":61,"text":62},[101,112,119],{"value":102,"source":85,"evidence":103},"Unclear advantage over running the whole thing in a container or using docker-py",[104,108],{"id":105,"by":106,"text":107},"11163932","richardwhiuk","I'm struggling to see the advantage of this? Surely either running the entire thing in the container and just running the command using subprocess would achieve the same effect....",{"id":109,"by":110,"text":111},"11163983","takee","Or, if you have docked installed on a system anyway why not just use docker-py (docker's python bindings) directly to run stuff in containers?",{"value":113,"source":85,"evidence":114},"Container runs need root or privileged access to docker",[115],{"id":116,"by":117,"text":118},"11165179","wdawson4","Does this require your Python app to run on a user in the docker group, thus giving your app Sudo privilege?",{"value":120,"source":85,"evidence":121},"Cannot pass container options such as network or DNS settings",[122],{"id":123,"by":124,"text":125},"11166855","ciokan","By looking at the code I can't seem to find a way of running the containers with options such as --net, --dns etc. Am I missing something or it's just not part of the plan?",[127],{"value":128,"source":85,"evidence":129},"Add pass-through options for Docker container settings",[130],{"id":131,"by":132,"text":133},"11167008","vkjv","Doesn't look like it. It looks like it's just a thin wrapper the `docker` module, which is a wrapper around the Docker API.…",[135,145],{"value":136,"source":85,"evidence":137},"How does it handle stdout and stderr output?",[138,142],{"id":139,"by":140,"text":141},"11165618","ThePhysicist","So if I understand correctly it basically launches the container and pipes the log output to a generator for consumption through Python?",{"id":143,"by":65,"text":144},"11165683","Yes. Not necessarily log output, but stderr and\u002For stdout.",{"value":146,"source":85,"evidence":147},"Does it need the user in the docker group?",[148],{"id":116,"by":117,"text":118},[150,156,163],{"value":27,"source":85,"evidence":151},[152,153],{"id":109,"by":110,"text":111},{"id":154,"by":65,"text":155},"11164072","you can! I found it difficult to work with and decided to make something new after reading this post: http:\u002F\u002Fblog.bordage.pro\u002Favoid-docker-py\u002F It's a few years old but I think…",{"value":157,"source":85,"evidence":158},"CommonWL",[159],{"id":160,"by":161,"text":162},"11164003","tetron","Going one step further, using http:\u002F\u002FCommonWL.org you can wrap Dockerized command line tools into callable Python functions, and abstracting all the details of stdin\u002Fstdout…",{"value":164,"source":85,"evidence":165},"subprocess",[166],{"id":105,"by":106,"text":107},{"comments":33,"answered":32,"key":168},[169,170,173],{"id":52,"text":53},{"id":171,"text":172},"11164093","This is really cool!",{"id":174,"text":175},"11172338","Glad you like it. We're curious to see what contraptions people come up with.",{"commenters":177,"max_depth":178,"maker_replies":33,"first_comment_mins":37,"lifespan_hours":179},18,4,27,[181,183,187,189,192,195,198,199,200,202,204,208,210,211,212,213,215,216,217,219,220,222,225,227,230,231,234,236,241],[52,32,32,182,11,42],"project\u002Fneutral\u002Fidea",[184,32,32,185,186,32],"11164956","other\u002Fneutral\u002Fnone","StavrosK",[188,32,32,185,65,32],"11164989",[190,32,32,185,191,32],"11165604","rantanplan",[193,32,32,185,194,32],"11166681","reinhardt",[196,32,32,197,186,32],"11167400","commenter\u002Fneutral\u002Fnone",[160,42,33,182,161,32],[171,42,32,185,11,42],[60,39,44,201,61,32],"project\u002Fpositive\u002Fidea",[203,39,44,201,65,32],"11164204",[205,33,42,206,207,32],"11166322","project\u002Fcritical\u002Fidea","arturhoo",[139,178,33,209,140,32],"project\u002Fneutral\u002Fnone",[143,178,33,209,65,32],[105,44,42,206,106,32],[109,44,42,206,110,32],[154,44,44,214,65,32],"project\u002Fpositive\u002Fexecution",[88,44,44,201,89,32],[64,44,44,201,65,32],[218,44,33,182,65,32],"11163995",[93,37,44,201,94,32],[221,37,44,214,65,32],"11164696",[116,223,33,224,117,32],7,"project\u002Fneutral\u002Fprivacy",[226,223,33,224,65,32],"11165323",[123,228,33,229,124,32],8,"project\u002Fneutral\u002Fexecution",[131,228,33,229,132,32],[232,31,44,201,233,32],"11165991","ilovefood",[174,31,32,235,11,42],"maker\u002Fpositive\u002Fnone",[237,238,33,239,240,32],"11163876",10,"project\u002Fneutral\u002Fdesign","youngbullind",[242,238,44,243,65,32],"11164030","project\u002Fpositive\u002Fdesign",[],[246,250,254,258,263,268],{"id":247,"name":248,"points":249,"category":20},"11155203","v86",356,{"id":251,"name":252,"points":253,"category":20},"11150209","how2",272,{"id":255,"name":256,"points":257,"category":20},"11167000","git-visualizer",141,{"id":259,"name":260,"points":261,"category":262},"11166062","etrigg",137,"consumer_social",{"id":264,"name":265,"points":266,"category":267},"11151062","Compelling Science Fiction",103,"creative",{"id":269,"name":270,"points":271,"category":272},"11153187","Bonsai (YC W16)",102,"web_saas",false,"v2",{"id":276,"name":5,"line":6,"ai":273,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":277,"top":18,"kw":278,"maker":11,"domain":10,"tier":19,"attempts":32,"strip":279,"url":9,"mix":280,"praise":84,"objection":102,"sub":21},11163639,0.11,[24,25,26,27],"00000030551331155535533335035",[31,31,32,33],1793990938990]