Lurker News

Comments (173) 27 threads

Earlier comments
benatkin2 replies#
I feel comfortable with fenced code blocks. Using heredocs all the time, not so much.

    ```js title="/root/server.js"
    console.log('test')
    ```
or

    `/root/server.js`

    ```js
    console.log('test')
    ```
vs

    RUN </root/server.js
    console.log('test')
    EOF
However the Markdown one is better if the syntax highlighting theme makes the code fence a color that doesn't stick out - either monochrome or closer to the background color.
pushedx#
The file is a Dockerfile with a shebang line that ignores the comments with a regex. Code fences would not be valid.

The point of this isn't to share this code, it's a demo of the clever shebang line.

bionhoward1 reply#
Brilliant idea. Single markdown file for a whole app stack?
benatkin#
Multiple markdown files, presenting code more like gists where you can read them top to bottom, plus with docs in between...
a_t481 reply#
That’s cute - though typically the docker images I build need supporting infra around them anyhow - I’d have to forward to the build script.
adtac3 replies#
I'm probably getting banned for committing this war crime but have you considered a

    #!/usr/bin/env -S bash -c "docker run --privileged ..."

    FROM docker

    RUN </other.Dockerfile
      #!/usr/bin/env -S bash -c "docker run ..."
      FROM debian:buster
    EOF
    RUN chmod +x /other.Dockerfile

    CMD bash -c "/other.Dockerfile &; ./main"
asn1parse2 replies#
heck, why not toss in --net=host
bravetraveler#
... and privileged, then make the entrypoint 'nsenter' for PID 1
yonatan8070#

    -v /:/sysroot
ta988#
could you make it curl a script as well
a_t482 replies#
No, but that’s a fun idea. Most of my docker crimes involve working around the lack of REBASE or similar to transplant a layer from another stage. Instead I’m forced to abuse rsync.
8organicbits#
I use `COPY --from=image` to move data between images. Do you need some more advanced features of rsync?
WhyNotHugo2 replies#
Using spaces in a shebang is not a standard thing and doesn’t work in most shells.
flakes1 reply#
Curious for what systems this does not work? I start a lot of my shebangs with `#!/usr/bin/env ` such that I can rely on PATH for resolving application locations.
chuckadams1 reply#
Just plain #!app also works. Probably less portable, but it does work on linux and macOS. Not sure if POSIX has anything to say about shebangs.
flakes1 reply#
Huh, I guess I've never given it too much thought. I was under the impression for some reason that the first argument was supposed to be an absolute path.

Continue this thread — 1 reply

phone86753092 replies#
Is this webscale?
mirekrusin#
It has web scales on it for sure.
scrps1 reply#
Is hyperscale.
jbverschoor#
hyperscale^3-8

Load more comments