Lurker News

Comments (173) 27 threads

Earlier comments
throwaway8922382 replies#
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 Dockerfile to docker build via STDIN. But you'd gain the ability to shellcheck the Bash, the code would be easier to read, write, maintain, add comments to, etc. You could keep the filename the same, run it the same way, etc. The way they've done it here is just unnecessarily difficult.

chii#
> You can still feed the Dockerfile to docker build via STDIN.

but you'd then have to work out how to "filter out" the bash commands inside this bash script to make it a valid docker file.
Unless of course, you entirely store the docker file contents inside heredocs. That works fine, but it's not as "cool" as "executing" dockerfiles as a script.

notso411#
You can say it is wrong without being insufferably condescending
nickstinemates6 replies#
another docker post filled with podman propaganda. despite it all, still no one uses it.
rtpg3 replies#
I mean I know several people who run their infra with podman. But it's for personal things, I don't know if there is any level of usage at the enterprise level.
viraptor1 reply#
Not enterprise level, but I made a choice of deploying podman at $job rather than docker for a few reasons.

Continue this thread — 1 reply

oso2k1 reply#
DISCLAIMER: I work for Red Hat. I'm formerly an OpenShift Consultant and SA.

podman has underpinned our Kubernetes distribution, OpenShift, since 4.0 was released in 2019. OpenShift is a $1B+ USD business for us (https://www.newsobserver.com/news/business/article271678707....). You can search and see a sample of who uses it for Enterprise level business.

Continue this thread — 1 reply

gbraad#
Podman Desktop sees a lot of increased use in the last few months and the PM has spoken with many of our 'customers' about the future and how they are using podman.

Disclaimer: working at Red Hat as a (tech) manager of the OpenShift Local team, involved on the virtualization targets for Podman Machine and the integration of some of our extensions.

ekianjo#
Still a useful alternative to docker and can be packaged in distros
65a#
I haven't used docker since ~2017. My clusters run on cri-o, builds are with kaniko, and some of my systems just call runc with OCI container definitions. Docker (especially its API) is a giant mess, and the sooner it's replaced by smaller tools and clear standards the better.
c0balt#
Can attest from $Job that there are podman users. Podman is awesome for some of our RHEL-based systems and we will continue to use it. You are just gonna hear about it a lot, because it's just a runtime.
christophilus#
I use it and love it. YMMV.
a-dub1 reply#
i think the kernel primitives are fine, unshare and namespaces make perfect sense to me. docker, podman, buildah, buildx, whatever... all these things with cutesy names and fatal flaws seem like the mess to me.
ksjskskskkk#
the feature IS the fatal flaw. after unsharing namespace you still want your network to "just work". the "quality"of the solution is directly proportional to how bad the security is.

the scale is non virtualized qemu all the way to docker which will even screw your iptables rules for your convenience. hn crowd falling in the middle as the Goldie locks we all are.

orhmeh091 reply#
No love for Apptainer/Singularity?
chubot#
What's that? What's good about it? :)
kevincox1 reply#
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 into some ugly script. They are into the slightest bit more difficult to ship around to different machines.
da39a3ee#
I think maybe it helps to think from the point of view of a developer for whom these single-file things are tools in their workshop.

- Easier to grep a collection of single files
- Easier to see what you've got in your collection in a directory listing (whether via a shell or in a web UI such as GitHib)
- Easier to view the contents quickly (`cat`)
- General philosophy that flat is better than nested

lwneal3 replies#
You can create this type of thing (a self-contained single-file project) for any language or infrastructure, with or without a clever shebang. All you need are heredocs.

For example, here's the same app but packaged as a regular bash script:
https://gist.github.com/lwneal/a24ba363d9cc9f7a02282c3621afa...

adtac#
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 Dockerfile that you can use with docker build, docker-compose, etc. in addition to being able to execute it.

bcjordan#
Yes I love this approach, I use this exact format as a way to get ChatGPT to work with an entire multi file programming project in a single idempotent bootstrapping script. Then ask for changes to be given as the entire file again
richdougherty#
Agree, nesting files with

    cat >Dockerfile <<'EOF'
and having a basic bash script seems way nicer than putting all the shell logic on the #! line.

Load more comments