#!
(pronounced shebang) is a Unix convention that's typically used for scripting languages like Python and Bash. This abuses it to let you package applications in a cross-distro and cross-platform way. This example Dockerfile is a fullstack server that includes a backend, a database and a UI, all in a single file.
It's kinda like Cosmopolitan Libc but for packaging applications.
Why not?
Probably not.
If you want.
Maybe.
No.
Yes.
chmod +x ./Dockerfile
./Dockerfile
Then go to http://127.0.0.1:8080
There was a bug in the she-bang line:
grep
is reading the wrong line. (needs to be the last line), so i fixed the shebang line by usingtac
to reverse the file, and thengrep -m 1
so if stops on first match. Final she-bang line:#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | tac | grep -m 1 -oP 'sha256:[0-9a-f]*')"