This repository has been archived on 2024-03-03. You can view files and clone it, but cannot push or open issues or pull requests.
clear-docker-images/README.md

49 lines
1.6 KiB
Markdown
Raw Normal View History

2022-02-09 00:03:09 +01:00
# clear-docker-images
`clear-docker-images` is a small rust binary made to cleanup old docker images but date, repository and tags.
## Usage
2022-02-17 22:38:47 +01:00
By default (it will change in the futur), `clear-docker-images` will select images that are older than 2 days old by default. You can choose to customize its behavior by filtering by repository, tags and from a specific date.
2022-02-09 00:07:38 +01:00
2022-02-09 00:03:09 +01:00
### Docker container
```bash
2022-02-17 22:17:13 +01:00
docker run --name clear-docker-image -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/datahearth/clear-docker-images <OPTIONS>
2022-02-09 00:03:09 +01:00
```
### Binary
```bash
mkdir -p $HOME/.local/bin
export PATH=$PATH:$HOME/.local/bin
# Available distribution: linux | darwin
2022-02-17 22:17:13 +01:00
wget -o $HOME/.local/bin/clear-docker-images ~/. https://github.com/DataHearth/clear-docker-images/releases/download/<VERSION>/x86_x64-<DISTRIBUTION>-clear-docker-images
2022-02-09 00:03:09 +01:00
clear-docker-images <OPTIONS>
```
### Source
```bash
git clone https://github.com/DataHearth/clear-docker-images.git
cd clear-docker-images
cargo install --path .
clear-docker-images <OPTIONS>
```
## Flags
2022-02-17 22:17:13 +01:00
```bash
-d, --date <DATE> filter by repository name (ISO 8601) [default: $NOW - 2 days]
--dry-run image cleanup will not be triggered
--force should docker force image removal (it may create orphan images)
-h, --help Print help information
-r, --repository <REPOSITORY> filter by repository name
-t, --tags <TAGS> add tags exclusion Example: -t 1.1.0 -t release
-v, --verbose add more logs
-V, --version Print version information
```