https://github.com/dwolla/staticbox
Staticbox is a static compilation of Busybox
https://github.com/dwolla/staticbox
Last synced: 3 months ago
JSON representation
Staticbox is a static compilation of Busybox
- Host: GitHub
- URL: https://github.com/dwolla/staticbox
- Owner: Dwolla
- License: mit
- Created: 2019-04-30T14:10:58.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-30T15:06:59.000Z (over 6 years ago)
- Last Synced: 2025-06-12T13:07:52.959Z (7 months ago)
- Language: Dockerfile
- Size: 15.6 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Staticbox
[](https://microbadger.com/images/dwolla/staticbox)
[](https://microbadger.com/images/dwolla/staticbox)
Staticbox is a static compilation of [Busybox](https://busybox.net/).
## Why?
If your filesystem is corrupted or deleted, a dynamically linked executable such as the default `busybox` binary on Alpine Linux will cease to function. Having a statically linked executable allows `busybox` to function even after, for example, the C standard library is deleted (i.e. `ld-musl-x86_64.so.1`).
## Usage
Staticbox can be used as a standalone Docker image or added to an existing Docker image:
```Dockerfile
FROM dwolla/staticbox:latest as staticbox
COPY --from=staticbox /staticbox /staticbox
ENV PATH=/staticbox/bin:$PATH
```
## Use Case
The impetus for creating Staticbox came from the inability to use the [durable-task-plugin](https://github.com/jenkinsci/durable-task-plugin) Jenkins Plugin with [kaniko](https://github.com/GoogleContainerTools/kaniko). The Durable Task Plugin allows processes to be run asynchronously on a build node and withstand disconnection of the slave agent. As such, this plugin assumes `touch` and `sleep` binaries are available and functioning on the agent. When kaniko deletes the filesystem between build stages, it eliminates these binaries and the libraries they depend on causing a deluge of error logs:
```
sh: touch: not found
sh: sleep: not found
```
Using Staticbox and adding its directory as a Docker volume fixes this issue. Docker volumes are whitelisted by kaniko, meaning that they are neither deleted between stages, nor added to the Docker image.
## Testing
```bash
while true; do echo "Hello, Staticbox!"; sleep 3; done
```
```bash
ls | grep -v staticbox | xargs rm -rf 2> /dev/null
```
**Note**: The above command will attempt to delete *all* files under `/` except for `/staticbox`.