[{"data":1,"prerenderedAt":696},["ShallowReactive",2],{"project-38987109":3},{"id":4,"name":5,"line":5,"line_source":6,"title":7,"url":8,"domain":9,"maker":10,"posted_at":11,"year":12,"points":13,"comments":14,"rank_in_year":15,"shown_in_year":16,"top":17,"tier":18,"category":19,"subcategory":20,"format":21,"keywords":22,"reception":28,"sentiment":29,"stance_mix":30,"scored_comments":35,"aspects":36,"strip":44,"post_text":47,"what":48,"said":76,"maker_in_thread":169,"shape":176,"grid":181,"attempts":659,"same_week":660,"maker_shows":41,"maker_hidden":688,"reader_version":689,"card":690},"38987109","#!\u002Fusr\u002Fbin\u002Fenv docker run","title","Show HN: #!\u002Fusr\u002Fbin\u002Fenv docker run","https:\u002F\u002Fgist.github.com\u002Fadtac\u002F595b5823ef73b329167b815757bbce9f","gist.github.com","adtac",1705202405,2024,496,173,66,3515,2,"legend","dev_tools","container build scripts","cli",[23,24,25,26,27],"dockerfile","shebang","docker run","executable script","single file","curious",-0.042,{"positive":31,"neutral":32,"mixed":33,"critical":34},11,27,4,12,54,{"execution":37,"performance":39,"idea":40,"design":42},{"positive":38,"critical":33},0,{"positive":38,"critical":38},{"positive":41,"critical":33},8,{"positive":43,"critical":43},3,[45,43,45,38,38,38,38,38,38,38,38,38,38,43,38,45,43,46,38,38,38,45,38,38,45,45,46,46,43,43,45,46,43,43,43,45,38,43,46,46],1,5,null,{"problem":49,"audience":47,"pricing":47,"motivation":58,"time_to_build":47,"stack":66,"openness":75,"stage":75,"team_size":75},{"value":50,"source":51,"evidence":52},"Running a Dockerfile as a standalone executable script in a single file","inferred",[53,55],{"id":54},"post",{"id":56,"by":10,"text":57},"38993247","Of course! Bash script is Turing complete so it should be possible to implement everything in it :) The only upside to having an executable Dockerfile is that it's still a valid…",{"value":59,"source":60,"evidence":61},"Hack together a static fat binary style deployment like Borg, and a fun trick","maker",[62,65],{"id":63,"by":10,"text":64},"38994231","It's funny you mentioned Google's internal infra because my motivation for this was to hack together something to emulate the kind of static fat binaries deployed on Borg.",{"id":56,"by":10,"text":57},[67,71],{"value":68,"source":51,"evidence":69},"Docker",[70],{"id":54},{"value":72,"source":51,"evidence":73},"Dockerfile",[74],{"id":54},"unknown",{"praise":77,"objections":94,"requests":124,"questions":132,"alternatives":140},[78],{"value":79,"source":80,"evidence":81},"Clever, fun hack","commenter",[82,86,90],{"id":83,"by":84,"text":85},"38989111","bionhoward","This is genius and I love how this is a whole app meta-seed in a single file! I think I have docker trauma, why did we reach a point where we need computers inside our computers…",{"id":87,"by":88,"text":89},"38990135","WhackyIdeas","I had no idea a shebang could be used like this! After all of these years… Nice hack. Love it.",{"id":91,"by":92,"text":93},"38987784","renewiltord","Haha very clever. I like it. L",[95,110,117],{"value":96,"source":80,"evidence":97},"Not a true shebang; env with spaces is non-portable",[98,102,106],{"id":99,"by":100,"text":101},"38989173","noname120","The -S \u002F --split-string option[1] of \u002Fusr\u002Fbin\u002Fenv is a relatively recent addition to GNU Coreutils. It's available starting from GNU Coreutils 8.30[2], released on 2018-07-01.…",{"id":103,"by":104,"text":105},"38988530","WhyNotHugo","Using spaces in a shebang is not a standard thing and doesn’t work in most shells.",{"id":107,"by":108,"text":109},"38987675","Kab1r","This isn't POSIX compliant is it? I feel like I tried to do something different but trying to put arguments in a shebang and ran into trouble there a year or two ago.",{"value":111,"source":80,"evidence":112},"Better as a plain bash script that could be shellchecked",[113],{"id":114,"by":115,"text":116},"38987655","throwaway892238","Cute trick, but it's not actually what the title claims. Since this is actually env calling bash first, not docker, this should just be a Bash script. You can still feed the…",{"value":118,"source":80,"evidence":119},"Single-file packaging is unnecessary; directories work fine",[120],{"id":121,"by":122,"text":123},"38989442","kevincox","This is cool hacking but I really don't get this obsession with \"single file\". Directories exist and can contain self-contained applications without the need to pack everything…",[125],{"value":126,"source":80,"evidence":127},"Exec so Docker replaces the bash process",[128],{"id":129,"by":130,"text":131},"38987454","keepamovin","Can we figure out a way to throw an exec into the shebang so the Docker process replaces the bash One?",[133],{"value":134,"source":80,"evidence":135},"What is the practical use?",[136],{"id":137,"by":138,"text":139},"38991505","Igor_Wiwi","what is the practical use of it?",[141,148,155,162],{"value":142,"source":80,"evidence":143},"nix-shell shebang",[144],{"id":145,"by":146,"text":147},"38989426","pedrovhb","For an actually intentional, non-cursed version of this, see the nix-shell shebang [0]: > #! \u002Fusr\u002Fbin\u002Fenv nix-shell > #! nix-shell -i python3 -p python3Packages.pillow…",{"value":149,"source":80,"evidence":150},"guix shell shebang",[151],{"id":152,"by":153,"text":154},"38990864","rekado","There's also `guix shell` which can be used in shebang position. Example from the Guix manual: ``` #!\u002Fusr\u002Fbin\u002Fenv -S guix shell python python-numpy -- python3 import numpy…",{"value":156,"source":80,"evidence":157},"podman-based self-building Dockerfile",[158],{"id":159,"by":160,"text":161},"38992470","mike-cardwell","I did this in Nov 2021 - https:\u002F\u002Fwww.grepular.com\u002FSelf_Building_and_Executing_Dockerfiles ``` #!\u002Fusr\u002Fbin\u002Fenv -S bash -c \"podman run --rm -w \u002Fx -v \"\\$PWD:\u002Fx\" \\$(podman build -q -…",{"value":163,"source":80,"evidence":164},"bubblewrap",[165],{"id":166,"by":167,"text":168},"38987688","chubot","Something like this should definitely exist, just not with Docker! Podman is better but it's also a bit coupled to a distro - https:\u002F\u002Fnews.ycombinator.com\u002Fitem?id=38981844 The…",{"comments":33,"answered":45,"key":170},[171,172,175],{"id":56,"text":57},{"id":173,"text":174},"38987380","I'm probably getting banned for committing this war crime but have you considered a ``` #!\u002Fusr\u002Fbin\u002Fenv -S bash -c \"docker run --privileged ...\" FROM docker RUN \u003C\u003CEOF cat…",{"id":63,"text":64},{"commenters":177,"max_depth":178,"maker_replies":33,"first_comment_mins":179,"lifespan_hours":180},124,10,46,178,[182,184,188,191,195,199,203,206,210,214,217,221,225,229,232,235,238,241,244,246,249,252,254,256,258,260,263,266,269,272,274,277,280,282,284,288,290,293,295,297,299,301,304,307,309,312,314,316,319,321,323,326,329,331,333,335,338,341,344,348,350,353,355,358,361,363,365,367,370,373,376,379,380,383,386,388,391,394,397,400,402,405,407,410,412,415,418,420,422,425,428,431,432,435,438,439,442,445,448,451,454,457,459,462,465,468,470,473,476,479,482,484,486,489,493,495,498,502,505,508,511,513,517,521,524,527,528,529,531,534,538,542,545,548,552,555,557,559,562,566,568,570,572,576,577,580,583,586,589,591,593,596,598,601,604,607,609,611,615,618,621,624,628,630,632,635,638,640,642,646,650,653,657],[145,38,38,183,146,38],"other\u002Fneutral\u002Fidea",[185,38,38,186,187,38],"38989662","other\u002Fneutral\u002Fnone","miduil",[189,38,38,186,190,38],"38989929","d0mine",[192,38,45,193,194,38],"38991229","project\u002Fcritical\u002Fexecution","nmz",[196,38,43,197,198,38],"38992540","project\u002Fneutral\u002Fexecution","pronoiac",[200,38,43,201,202,38],"38993121","project\u002Fneutral\u002Fperformance","zopa",[204,38,38,186,205,38],"39002472","YoshiRulz",[207,38,38,208,209,38],"38996820","other\u002Fneutral\u002Fdocs","jdxcode",[211,38,38,212,213,38],"39000935","commenter\u002Fneutral\u002Fidea","adastra22",[215,38,38,186,216,38],"39023008","tomberek",[218,45,45,219,220,38],"38987388","project\u002Fcritical\u002Fidea","pushedx",[222,45,43,223,224,38],"38987504","project\u002Fneutral\u002Fidea","8organicbits",[226,45,38,227,228,38],"38987545","commenter\u002Fneutral\u002Fnone","t0astbread",[230,45,38,227,231,38],"38988249","pjmlp",[233,45,38,186,234,38],"38987593","alganet",[236,45,38,227,237,38],"38987528","erik_seaberg",[239,45,38,227,240,38],"38988002","HumanOstrich",[242,45,38,227,243,38],"38989748","leonheld",[245,45,38,186,237,38],"38994492",[247,45,38,186,248,38],"38987543","doctorpangloss",[250,45,38,186,251,38],"38987642","tomjen3",[253,45,38,186,248,38],"38987711",[255,45,38,208,251,38],"38988163",[257,45,38,208,231,38],"38988237",[259,45,38,208,251,38],"38988501",[261,45,38,186,262,38],"38988180","gnatolf",[264,45,38,186,265,38],"38988794","reactordev",[267,45,38,186,268,38],"38987768","cowboyscott",[270,45,38,227,271,38],"38987839","cpuguy83",[273,45,38,186,268,38],"38987921",[275,45,38,186,276,38],"38989829","smitty1e",[278,45,38,186,279,38],"38991849","samstave",[281,45,38,186,276,38],"38992946",[283,45,38,186,231,38],"38988205",[285,45,38,286,287,38],"38988821","other\u002Fcritical\u002Fnone","opentokix",[289,45,38,186,231,38],"38988845",[291,45,38,186,292,38],"38988885","asmor",[294,45,38,186,231,38],"38989092",[296,45,38,186,292,38],"38989316",[298,45,38,186,231,38],"38993467",[300,45,38,186,292,38],"39000837",[302,45,38,186,303,38],"38991822","marcosdumay",[305,45,38,186,306,38],"38993353","temporarara",[308,45,38,186,231,38],"38993458",[310,45,38,186,311,38],"38992202","vajrabum",[313,45,38,186,231,38],"38993452",[315,45,38,186,311,38],"38994432",[317,45,38,186,318,38],"38993235","Brian_K_White",[320,45,38,186,231,38],"38993478",[322,45,38,186,318,38],"38993828",[324,45,38,186,325,38],"38989392","supriyo-biswas",[327,45,38,186,328,38],"38991676","mardifoufs",[330,45,38,186,231,38],"39010481",[332,45,38,186,328,38],"39023275",[334,45,38,186,84,38],"38989125",[336,45,38,186,337,38],"38990127","GuB-42",[339,45,38,340,248,38],"38992123","other\u002Fneutral\u002Fperformance",[342,45,38,186,343,38],"38991937","duped",[345,45,43,346,347,38],"38987592","project\u002Fneutral\u002Fnone","riffic",[349,45,38,186,213,38],"38988111",[351,45,38,227,352,38],"38988131","voxic11",[354,45,38,227,231,38],"38988251",[356,45,38,227,357,38],"38988727","chx",[359,45,38,227,360,38],"38989152","ric2b",[362,45,38,227,213,38],"38992088",[364,45,38,227,360,38],"39078380",[366,45,38,227,231,38],"38988202",[368,45,45,193,369,38],"38988974","Arch-TK",[371,45,43,197,372,38],"38991298","willio58",[374,45,38,227,375,38],"38991914","edgyquant",[377,45,43,346,378,38],"38992309","shepherdjerred",[99,17,43,197,100,38],[381,17,43,197,382,38],"38989586","riedel",[384,17,38,227,385,38],"39010544","habitue",[83,43,46,387,84,38],"project\u002Fpositive\u002Fidea",[389,43,38,186,390,38],"38989289","petercooper",[392,43,38,227,393,38],"38989351","zarzavat",[395,43,38,227,396,38],"38989416","drsh0",[398,43,38,227,399,38],"38991971","vrighter",[401,43,38,227,393,38],"38994305",[403,43,38,186,404,38],"38989359","throwaway290",[406,43,38,186,202,38],"38992346",[408,43,38,186,409,38],"38994470","ParetoOptimal",[411,43,38,183,190,38],"38990002",[413,43,38,183,414,38],"38991746","layer8",[416,43,38,186,417,38],"38994022","mieubrisse",[419,43,38,227,414,38],"38994790",[421,43,38,186,417,38],"39005652",[423,43,38,186,424,38],"38989842","teknopaul",[426,43,38,186,427,38],"38990522","bornfreddy",[429,43,43,223,430,38],"38989888","photonthug",[114,33,45,193,115,38],[433,33,38,227,434,38],"38987822","chii",[436,33,38,227,437,38],"38988206","notso411",[166,46,45,219,167,38],[440,46,38,227,441,38],"38987886","nickstinemates",[443,46,38,227,444,38],"38987888","rtpg",[446,46,38,227,447,38],"38987947","viraptor",[449,46,38,227,450,38],"38988674","KAMSPioneer",[452,46,38,227,453,38],"38988144","oso2k",[455,46,38,227,456,38],"38990600","gbraad",[458,46,38,227,456,38],"38991588",[460,46,38,227,461,38],"38987896","ekianjo",[463,46,38,186,464,38],"38988300","65a",[466,46,38,227,467,38],"38988927","c0balt",[469,46,38,227,325,38],"38989373",[471,46,38,186,472,38],"38989764","christophilus",[474,46,45,219,475,38],"38987908","a-dub",[477,46,38,227,478,38],"38988201","ksjskskskkk",[480,46,38,227,481,38],"38988601","orhmeh09",[483,46,38,227,167,38],"38990757",[121,485,45,219,122,38],6,[487,485,46,387,488,38],"38990515","da39a3ee",[490,491,43,223,492,38],"38993127",7,"lwneal",[56,491,38,494,10,45],"maker\u002Fneutral\u002Fnone",[496,491,46,387,497,38],"38995202","bcjordan",[499,491,46,500,501,38],"38999481","project\u002Fpositive\u002Fdesign","richdougherty",[503,41,38,183,504,38],"38988696","jcul",[506,41,38,186,507,38],"38990433","jordemort",[509,41,38,186,510,38],"38991389","chriswarbo",[512,41,38,227,504,38],"38998259",[514,515,43,346,516,38],"38988422",9,"forrestthewoods",[518,515,43,519,520,38],"38988442","project\u002Fmixed\u002Fidea","BossingAround",[522,515,43,223,523,38],"38989449","amne",[525,515,43,519,526,38],"38988509","maronato",[152,178,43,346,153,38],[107,31,43,346,108,38],[530,31,43,346,271,38],"38987849",[532,31,43,346,533,38],"38988333","error9348",[535,31,45,536,537,38],"38989510","project\u002Fcritical\u002Fnone","cerved",[539,34,45,540,541,38],"38987335","project\u002Fcritical\u002Fdesign","tzury",[543,34,45,540,544,38],"38987419","jonahx",[546,34,38,227,547,38],"38987759","d-z-m",[549,34,43,550,551,38],"38987438","project\u002Fmixed\u002Fdesign","mattigames",[553,34,46,500,554,38],"38987629","devoutsalsa",[159,556,43,346,160,38],13,[129,558,43,197,130,38],14,[560,561,46,387,424,38],"38989797",15,[563,564,45,540,565,38],"38987420",16,"benatkin",[567,564,38,227,220,38],"38987595",[569,564,46,387,84,38],"38989159",[571,564,43,223,565,38],"38995042",[573,574,43,519,575,38],"38987338",17,"a_t48",[173,574,38,494,10,45],[578,574,38,227,579,38],"38987392","asn1parse",[581,574,38,227,582,38],"38987444","bravetraveler",[584,574,38,227,585,38],"38987455","yonatan8070",[587,574,43,346,588,38],"38987443","ta988",[590,574,43,494,575,38],"38987474",[592,574,38,227,224,38],"38987536",[594,574,43,346,595,38],"38988702","efrecon",[103,597,45,193,104,38],18,[599,597,38,227,600,38],"38988578","jstanley",[602,597,38,227,603,38],"38988600","flakes",[605,597,38,227,606,38],"38991719","chuckadams",[608,597,38,227,603,38],"38998737",[610,597,38,227,606,38],"39004772",[612,613,38,186,614,38],"38987657",19,"phone8675309",[616,613,38,186,617,38],"38988282","mirekrusin",[619,613,38,186,620,38],"38988615","scrps",[622,613,38,186,623,38],"38989223","jbverschoor",[625,626,43,346,627,38],"38995388",20,"fruktmix",[629,626,43,346,627,38],"38995406",[137,631,43,223,138,38],21,[633,631,38,227,634,38],"38993043","dailykoder",[636,631,46,387,637,38],"38994125","cflewis",[63,631,38,639,10,45],"maker\u002Fneutral\u002Fidea",[87,641,46,387,88,38],22,[643,644,43,197,645,38],"38988583",23,"kitd",[647,648,43,197,649,38],"38991566",24,"mgaunard",[651,648,38,652,10,45],"38992497","maker\u002Fneutral\u002Fexecution",[654,655,46,500,656,38],"38987671",25,"IggleSniggle",[91,658,46,387,92,38],26,[],[661,666,671,675,679,683],{"id":662,"name":663,"points":664,"category":665},"39022693","sitinshade.com",963,"consumer_social",{"id":667,"name":668,"points":669,"category":670},"38951172","GodotOS",534,"productivity",{"id":672,"name":673,"points":674,"category":19},"38971966","Marimo",448,{"id":676,"name":677,"points":678,"category":670},"38988019","Citadel",338,{"id":680,"name":681,"points":682,"category":19},"39027543","Htmldocs",226,{"id":684,"name":685,"points":686,"category":687},"39030510","Shadeup",179,"languages",false,"v2",{"id":691,"name":5,"line":5,"ai":688,"cat":19,"year":12,"points":13,"comments":14,"rec":28,"s":692,"top":17,"kw":693,"maker":10,"domain":9,"tier":18,"attempts":38,"strip":694,"url":8,"mix":695,"praise":79,"objection":96,"sub":20},38987109,-0.04,[23,24,25,26,27],"1310000000000301350001001155331533310355",[31,32,33,34],1794036648117]