whaler
What? A command-line tool for visually investigating the disk usage of docker images
Why? Large images are slow to move and expensive to store. They cost developer productivity by lengthening devops tasks and often contain unnecessary data
Who is this for? Primarily for engineers working with images containing Python packages.
User Stories
This tool should allow you to answer questions such as:
- Which file types are occupying the most disk space?
- Which are my largest Python packages?
- What are my unknown causes of high disk usage?
Quick start
pip install whaler
Run against a local directory
➜ whaler .venv
Running bash -c cd .venv && du -a -k
Done. Serving output at http://localhost:8000 (ctrl+c to exit)
Running python3 -m http.server 8000 --directory=_whaler/html
Run against a docker image
The tool will pull the image first if it is not present.
whaler --image='hl:latest' /
Running docker run --rm --entrypoint=du --workdir=/ hl:latest -a -k
Ignoring what seems to be non-fatal error(s):
du: cannot access './proc/1/task/1/fd/4': No such file or directory
du: cannot access './proc/1/task/1/fdinfo/4': No such file or directory
du: cannot access './proc/1/fd/3': No such file or directory
du: cannot access './proc/1/fdinfo/3': No such file or directory
Done. Serving output at http://localhost:8000 (ctrl+c to exit)
Running python3 -m http.server 8000 --directory=_whaler/html
Play with a hosted demo
Limitations
- Platform: whaler uses
duto gather disk usage data. It must be present in your docker image - Scale: I have tested the web UI with up to 500,000 file system nodes with
duoutput of up to ~100MB.
Alternatives/Complements to this tool:
- Whaler can tell you what is taking up space in the final layer of your Docker image, but you may have intermediate layers which are contributing to the image size. For diving through the layers, use dive
- Related: read up on multi-stage builds to understand how to mitigate the problem of intermediate layers bloating your image.
- For investigating disk usage in non-docker directories, Disk Inventory X is a great tool on OS X which I have based whaler on.
Developing
See .github/workflows/test.yml for the development platform and setup.
For UI, see whaler-ui
Metadata
Release files for whaler 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| whaler-0.1.2.tar.gz | 497.6 kB | Without provenance | Details for whaler-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| whaler-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for whaler-0.1.2-py3-none-any.whl |
Total release size: 992.9 kB
Release files / whaler-0.1.2.tar.gz
| Download URL | whaler-0.1.2.tar.gz |
|---|---|
| Size | 497.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8be052108ee5ca219ceb5aa65c1db061dcc5193ed1ac82ad43c86cea15769332
|
|
BLAKE2b-256 checksum How to use checksums |
9e19169d6b3c80e73780b798625b04ba9b282bba30f9dfbb4dd0eb61fb44aa71
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.7
|
Release files / whaler-0.1.2-py3-none-any.whl
| Download URL | whaler-0.1.2-py3-none-any.whl |
|---|---|
| Size | 495.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
92e502a1eba0da67ec5ccf10cc1bacabd80f38303b826db810037247e0cfe3c9
|
|
BLAKE2b-256 checksum How to use checksums |
bcdfda32ad9d13f412fcd1876aff956477abcb16357767c2e976f23176076bc5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.7
|
Security for whaler 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.