Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/remorses/docker-phobia
Analyze Docker images size
https://github.com/remorses/docker-phobia
Last synced: 15 days ago
JSON representation
Analyze Docker images size
- Host: GitHub
- URL: https://github.com/remorses/docker-phobia
- Owner: remorses
- Created: 2024-03-31T09:48:13.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-27T15:41:11.000Z (4 months ago)
- Last Synced: 2024-10-03T09:20:16.982Z (about 1 month ago)
- Language: JavaScript
- Homepage: https://docker-phobia-website-gang.vercel.app
- Size: 51.8 MB
- Stars: 616
- Watchers: 6
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- my-awesome - remorses/docker-phobia - 10 star:0.6k fork:0.0k Analyze Docker images size (JavaScript)
README
docker-phobia
analyze Docker images and make them slim
## Install
You can install docker-phobia with:
```bash
curl -sf https://goblin.run/github.com/remorses/docker-phobia | sh
# goblin.run will build the binary and place it in PATH
# if you have go installed you can also do
go install github.com/remorses/docker-phobia@latest
```## Usage
```bash
docker-phobia
# Use the arrow keys to navigate: ↓ ↑ → ←
# ? Select a Docker image:
# ▸ node:18-slim
# postgres:latest# or pass the image tag as an argument
docker-phobia node:18-slim
```## Example Output
Every rectangle represents a folder or file in the image. The bigger the rectangle, the more space it takes up.
The different colors represent the different layers in the image. If two rectangles have the same color, they are in the same layer. If the color shade is similar, they are from layers close to each other.
![example treemap](./website/public/example-docker-phobia.png)
## How it works
Execute docker-phobia to initiate a Go script that leverages [dive](https://github.com/wagoodman/dive) internal API for Docker image retrieval and analysis, outputting a JSON file structure with file sizes. Concurrently, it spins up a server on port 8080 and launches docker-phobia.vercel.app, which visualizes the JSON data as a treemap.
## Roadmap
- [x] Show the size for each rect on hover as tooltip
- [x] Use better domain
- [ ] Use tags to version the cli
- [ ] Add share button to share the treemap with anyone without installing again, use the image SHA in the url.
- [ ] Automatically store public images (images from DockerHub with SHA already published) in a docker-phobia directory indexed on Google. People can see images size between versions and tags.