The get-subnets script is designed to search for docker-compose.yml files within a specified folder and extract subnet values and project names from them. It displays the extracted information including duplicate subnets and provides relevant metrics.
- Clone the repository.
- Run
npm installto install dependencies.
To use the script, follow these steps:
- Navigate to the root directory of the project.
- Run the script using the following command:
npm run exec <folder>Replace <folder> with the path to the directory you want to search for docker-compose.yml files in.
A Docker image is available on Docker Hub. To use the image, follow these steps:
- Pull the image from Docker Hub:
docker pull rowin1125/get-subnets:latest- Run the image using the following command:
docker run -v <source_folder>:/usr/src/app/files rowin1125/get-subnets:latestReplace <source_folder> with the path to the folder you want to search for docker-compose.yml files in.
To run the script within a Docker container, follow these steps:
- Ensure you have Docker installed and running on your system.
- Build the Docker image using the provided Dockerfile:
docker build -t <image_name> .`- Mount the folder containing the files you want to search to the Docker container by specifying the source folder and mounting path. Replace
<source_folder>with the path to the folder you want to search. For example, if you want to search the~/Projects/folder, use:
docker run -v <source_folder>:/usr/src/app/files <image_name>- Node.js
- Docker (if running in a Docker container)
This script is released under the MIT License.