30 lines
1.4 KiB
Markdown
30 lines
1.4 KiB
Markdown
# What is BusyBox? The Swiss Army Knife of Embedded Linux
|
|
|
|
Coming in somewhere between 1 and 5 Mb in on-disk size (depending on the variant), [BusyBox](http://www.busybox.net/) is a very good ingredient to craft space-efficient distributions.
|
|
|
|
BusyBox combines tiny versions of many common UNIX utilities into a single small executable. It provides replacements for most of the utilities you usually find in GNU fileutils, shellutils, etc. The utilities in BusyBox generally have fewer options than their full-featured GNU cousins; however, the options that are included provide the expected functionality and behave very much like their GNU counterparts. BusyBox provides a fairly complete environment for any small or embedded system.
|
|
|
|
> [wikipedia.org/wiki/BusyBox](https://en.wikipedia.org/wiki/BusyBox)
|
|
|
|
%%LOGO%%
|
|
|
|
# How to use this image
|
|
|
|
## Run BusyBox shell
|
|
|
|
```console
|
|
$ docker run -it --rm %%IMAGE%%
|
|
```
|
|
|
|
This will drop you into an `sh` shell to allow you to do what you want inside a BusyBox system.
|
|
|
|
## Create a `Dockerfile` for a binary
|
|
|
|
```dockerfile
|
|
FROM %%IMAGE%%
|
|
COPY ./my-static-binary /my-static-binary
|
|
CMD ["/my-static-binary"]
|
|
```
|
|
|
|
This `Dockerfile` will allow you to create a minimal image for your statically compiled binary. You will have to compile the binary in some other place like another container. For a simpler alternative that's similarly tiny but easier to extend, [see `alpine`](https://hub.docker.com/_/alpine/).
|