Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yoloftw/node-docker-prune

Node-Docker-Prune is a Node.js app designed to automate the process of pruning unused docker images
https://github.com/yoloftw/node-docker-prune

docker docker-prune node node-schedule

Last synced: 3 months ago
JSON representation

Node-Docker-Prune is a Node.js app designed to automate the process of pruning unused docker images

Awesome Lists containing this project

README

        

Node-Docker-Prune

[![Status](https://img.shields.io/badge/status-active-success.svg)]()
[![GitHub Issues](https://img.shields.io/github/issues/YoloFTW/Node-Docker-Prune.svg)](https://github.com/YoloFTW/Node-Docker-Prune/issues)
[![GitHub Pull Requests](https://img.shields.io/github/issues-pr/YoloFTW/Node-Docker-Prune.svg)](https://github.com/YoloFTW/Node-Docker-Prune/pulls)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE)

---

## 📝 Table of Contents

- [About](#about)

- [Installing](#installing)

- [Configuration](#Configuration)

- [Usage](#usage)

- [License](#License)

- [Contribution](#Contribution)

- [Sponsored by](#SponsoredBy)

- [Authors](#authors)

## About

Node-Docker-Prune is a Node.js app designed to automate the process of pruning unused docker images by running the "docker image prune -a" command periodically. This app is particularly useful for managing game servers, web applications, or any service that requires periodic pruning of docker images to ensure optimal performance.

## Installing

To install Node-Docker-Prune, clone the Git repository to your local machine:

```bash
git clone https://github.com/YoloFTW/Node-Docker-Prune.git

cd Node-Docker-Prune

npm install
```

## Configuration

To configure Node-Docker-Prune edit the .env file with the correct time and discord webhook url.

The default time is set at 00:00:00 each day.

You can also edit the "TITLE" variable to change how the module is reflected in the webhook message.

Node-Docker-Prune will also need elevated privilages to run. This can be acomplished either by running as sudo **NOT RECOMENDED** or by running the app as a user with access to docker commands.

This can be done with:

```bash
sudo adduser newuser
```

The new user then can be added to the docker group with:

```shell
sudo usermod -aG docker newuser
```

## Usage

To start Node-Docker-Prune, run the following command:

```bash
node index.js
```

If you want to use the new user whilst logged into a different acoount, this can be acomplished with:

```bash
sudo -u newuser node index.js
```

Once configured and started, Node-Docker-Prune will handle the automatic pruning of unused docker images as per the defined schedule. It will also send status updates to the specified Discord webhook after each restart.

## License
This project is licensed under the MIT License. See the [LICENSE](/LICENSE) file for details.

## Contribution

Contributions are welcome! If you find a bug or have any suggestions, please open an issue or create a pull request.

## Sponsored by

This has been sponsored by [Cybrancee](https://cybrancee.com/andreisawesome)

## Authors

- [@YoloFTW](https://github.com/YoloFTW)