Skip to content

Commit

Permalink
Clean up the README
Browse files Browse the repository at this point in the history
It's been a long time since I started this repo.
  • Loading branch information
robxu9 committed Jul 11, 2021
1 parent 8b7c6f8 commit 0c91f66
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 10 deletions.
26 changes: 17 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,35 @@
Because we all need the most static bash we can get in this world.

## Getting

Download from the Releases section or run `./build.sh`.

Note that you really can't have truly static binaries on Darwin or
Windows machines, because there are no static libraries that can be used.
But this will ensure that Darwin or Windows bash binaries will not rely on
anything else but their libcs.

On Linux, we use musl instead of glibc to avoid `dlopen()`.

## What's the point of this?
I can run bash anywhere! Even an empty Docker container.
## Rationale

```
This started as an experiment in Jan 2015 when Glider Labs was testing the
viability of potentially using just a statically linked bash entrypoint
as the only entrance into a container. So the following works:

```sh
FROM scratch
ADD bash
ENTRYPOINT ['/bash']
```

And it'll just work™. Well, you'll be missing all the coreutils, so
it'll be close to useless, but hey! It works! You could probably add busybox
in now.
Adding in busybox would make the container relatively feature-complete
for debugging or just for common tools. This works great with a
container image that has busybox (i.e `progrium/busybox`).

If you're not going for purely static minimalism, you can achieve a similar
result just by using Alpine today, also discovered during this experiment in 2015.

## Sponsored by...
> Really?
## License

But actually. [Glider Labs](http://gliderlabs.com/). Cool people.
MIT
20 changes: 19 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
#!/bin/bash
#
# build static bash because we need exercises in minimalism
# MIT licensed: google it or see robxu9.mit-license.org.
# Copyright © 2015 Robert Xu <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the “Software”), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# For Linux, also builds musl for truly static linking if
# musl is not installed.
Expand Down

0 comments on commit 0c91f66

Please sign in to comment.