{"id":15065985,"url":"https://github.com/mkhuda/dockermi","last_synced_at":"2026-01-02T19:10:56.899Z","repository":{"id":250546198,"uuid":"834745389","full_name":"mkhuda/dockermi","owner":"mkhuda","description":"Dockermi is a command-line tool for managing Docker services defined in `docker-compose.yml` files","archived":false,"fork":false,"pushed_at":"2024-08-04T14:14:44.000Z","size":101,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-10T23:37:11.296Z","etag":null,"topics":["cli","command-line","command-line-tool","docker","docker-compose","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mkhuda.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-28T08:24:29.000Z","updated_at":"2024-08-04T14:14:47.000Z","dependencies_parsed_at":"2024-09-29T11:00:49.392Z","dependency_job_id":"af794ecf-285b-4b8a-940a-7c9834cd718d","html_url":"https://github.com/mkhuda/dockermi","commit_stats":null,"previous_names":["mkhuda/dockermi"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkhuda%2Fdockermi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkhuda%2Fdockermi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkhuda%2Fdockermi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkhuda%2Fdockermi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkhuda","download_url":"https://codeload.github.com/mkhuda/dockermi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243809885,"owners_count":20351407,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","command-line","command-line-tool","docker","docker-compose","go","golang"],"created_at":"2024-09-25T00:59:01.642Z","updated_at":"2026-01-02T19:10:56.871Z","avatar_url":"https://github.com/mkhuda.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dockermi\n[![Go Reference](https://pkg.go.dev/badge/github.com/mkhuda/dockermi.svg)](https://pkg.go.dev/github.com/mkhuda/dockermi) ![test workflow](https://github.com/mkhuda/dockermi/actions/workflows/go.yml/badge.svg)\n\n**Dockermi** is a command-line tool for managing Docker services defined in `docker-compose.yml` files. It simplifies the process of starting and stopping multiple Docker services with a single command, generating a shell script (`dockermi.sh`) that can be executed to perform the desired actions.\n![dockermi - docker-compose](https://github.com/user-attachments/assets/f8045f6b-3706-4535-8376-52741daa84b1)\n\n## Features\n\n- Automatically discovers `docker-compose.yml` files in the current directory and its subdirectories.\n- Generates a shell script (`dockermi.sh`) for managing services.\n- Supports starting and stopping services with simple commands.\n- Provides colored logs for better readability and user experience.\n- Easy to use and integrate into existing workflows.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [Help](#help)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Installation\n\n### Prerequisites\n\n- [Go](https://golang.org/dl/) (version 1.18 or later)\n- Docker and Docker Compose installed on your system.\n\n### Installing Dockermi\n\nTo install the Dockermi application, follow the instructions below based on your operating system.\n\n### For Linux and macOS\n#### Instant method (download latest)\n```\nwget -qO- https://github.com/mkhuda/dockermi/releases/download/v0.1.6/dockermi-linux-v0.1.6.tar.gz | sudo tar xz -C /usr/local/bin \u0026\u0026 sudo mv /usr/local/bin/dockermi-linux-v0.1.6 /usr/local/bin/dockermi \u0026\u0026 sudo chmod +x /usr/local/bin/dockermi\n```\n\n#### Using manual build.sh or install.sh \n1. Open your terminal and clone this repo `git clone https://github.com/mkhuda/dockermi.git`.\n2. Navigate to the directory where you have the Dockermi project:\n   ```bash\n   cd path/to/your/dockermi\n   ```\n3. Make the build and installation script executable:\n   ```bash\n   chmod +x install.sh build.sh\n   ```\n4. Run the build script:\n   ```bash\n   ./build.sh\n   ```\n5. Run the installation script with **sudo**:\n   ```bash\n   sudo ./install.sh\n   ```\n\nThis will build the application for your OS and install it to `/usr/local/bin`, making it available for execution from anywhere in your terminal.\n\n### For Windows\n\n1. Open Command Prompt and clone this repo `git clone https://github.com/mkhuda/dockermi.git`.\n2. Navigate to the directory where you have the Dockermi project:\n   ```cmd\n   cd path\\to\\your\\dockermi\n   ```\n3. Run the build script:\n   ```cmd\n   build.bat\n   ```\n4. Run the installation script:\n   ```cmd\n   install.bat\n   ```\n\nThis will build the application for Windows and install it to `C:\\Program Files\\dockermi`, making it available for execution from anywhere in your command prompt.\n\n## Running Dockermi\n\nOnce installed, you can run the Dockermi application by typing:\n\n```bash\ndockermi\n```\n\nin your terminal (Linux and macOS) or command prompt (Windows).\n\n### Uninstallation\n\nTo uninstall Dockermi, you will need to manually remove the installed binary:\n\n- **Linux and macOS**:\n  ```bash\n  sudo rm /usr/local/bin/dockermi\n  ```\n\n- **Windows**:\n  ```cmd\n  del \"C:\\Program Files\\dockermi\\dockermi.exe\"\n  ```\n\n### Build the Executable\n\n1. Clone the repository to your local machine:\n\n    ```bash\n    git clone https://github.com/mkhuda/dockermi.git\n    cd dockermi\n    ```\n\n2. Build the `dockermi` executable:\n\n    ```bash\n    ./build.sh\n    ```\n\n### Make the Executable Available\n\nYou can move the built executable to a directory in your `PATH` for easier access:\n\n```bash\nsudo mv dockermi /usr/local/bin/\n```\n\n\n## Usage\n\nTo generate the `dockermi.sh` script, run:\n\n```bash\ndockermi\n```\n\nThis command creates a `dockermi.sh` script in the current directory, which contains functions for starting and stopping (at the moment) your Docker services.\n\n### Annotations in docker-compose.yml\n\n#### 1. `dockermi.order`\n\n- **Description**: This annotation specifies the order in which the Docker services should be started or stopped. Services with lower order values are started before those with higher values. This is particularly useful when certain services depend on others being up and running first.\n\n- **Type**: String (represents a numeric value)\n\n- **Example**:\n    ```yaml\n    services:\n      web:\n        image: nginx:latest\n        ports:\n          - \"80:80\"\n        labels:\n          dockermi.order: \"1\"  # This service will start first\n    ```\n\n- **Usage**: You can set this label in your `docker-compose.yml` to control the startup order of your services, ensuring that dependencies are handled appropriately. For example, a database service might have an order of `1`, while a web service that depends on it could have an order of `2`.\n\n- **Multiple Services**: If multiple services are defined in the `docker-compose.yml` file with the same `dockermi.order`, only the first service that appears in the file will be used for execution. Be mindful of the order in which services are listed.\n\n#### 2. `dockermi.active`\n\n- **Description**: This annotation indicates whether the service is currently active or should be started when the `dockermi.sh` script is executed. If set to `\"true\"`, the service will be included in the startup process. If set to `\"false\"`, the service will be skipped during startup.\n\n- **Type**: String (boolean value, \"true\" or \"false\")\n\n- **Example**:\n    ```yaml\n    services:\n      web:\n        image: nginx:latest\n        ports:\n          - \"80:80\"\n        labels:\n          dockermi.active: \"true\"  # This service is active and will be started\n    ```\n\n- **Usage**: Use this label to manage which services should be actively started or stopped. For instance, if you have a service that is temporarily not needed, you can set `dockermi.active: \"false\"` to prevent it from starting.\n\n#### 3. [Experimental] `dockermi.key`\n- **Description**: This annotation will be used later if a grouping service is implemented. We aim to make the `dockermi.sh` file be saved in the `/home/.dockermi/*` folder.\n\nHere is how you might define a service in your `docker-compose.yml` file using both annotations:\n\n```yaml\nversion: '3.8'\n\nservices:\n  web:\n    image: nginx:latest\n    ports:\n      - \"80:80\"\n    labels:\n      dockermi.order: \"1\"    # Service start order\n      dockermi.active: \"true\" # This service is active\n      dockermi.key: \"group1\" # a group of service\n\n  db:\n    image: mysql:latest\n    environment:\n      MYSQL_ROOT_PASSWORD: root\n    labels:\n      dockermi.order: \"2\"    # This service will start after 'web'\n      dockermi.active: \"true\" # This service is also active\n      dockermi.key: \"group1\"\n```\n\n#### Summary\n\n- The `dockermi.order` annotation controls the startup order of services.\n- The `dockermi.active` annotation determines whether a service should be active during the execution of the `dockermi.sh` script \n- The `dockermi.key` [experimental] annotation serves as a unique identifier for a service (grouping), allowing for easier reference and management within the Docker environment.\n- When multiple services have the same `dockermi.order`, only the first service that appears in the `docker-compose.yml` file will be used for execution.\n- Using these annotations helps to manage complex service dependencies effectively, ensuring that the right services are up and running when needed.\n\n#### Further Considerations\n\n- **Multiple Services**: When defining multiple services, ensure that their `dockermi.order` values are unique (still ok, if there is multiple version) and reflect the intended startup sequence. If services share the same order value, only the first one listed will be activated, which can lead to unexpected behavior if not managed correctly.\n- **Dynamic Activation**: You can dynamically set the `dockermi.active` label based on environment variables or configuration settings to enable/disable services as needed.\n\nBy incorporating these annotations into your `docker-compose.yml` file, you can leverage the full power of Dockermi to manage your Docker services efficiently. If you have any further questions or need clarification, feel free to ask!\n\n\n### Running the Generated Script\n\n1. To start the services defined in your `docker-compose.yml` files, run:\n\n    ```bash\n    dockermi up (--args referred to docker compose arg)\n    ```\n\n2. To stop the services, run:\n\n    ```bash\n    dockermi down (--args referred to docker compose arg)\n    ```\n\n### Help\n\nTo display help information for the `dockermi` command, run:\n\n```bash\ndockermi --help\n```\n\nThis will show the usage details and available commands.\n\n6. **Create a Pull Request**: Go to the original repository and click on \"New Pull Request.\"\n\n### Issues\n\nIf you encounter any bugs or have suggestions for improvements, please feel free to open an issue on the GitHub repository.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- Thanks to the contributors and the open-source community for their support and inspiration.\n- Special thanks to the maintainers of Go, Docker, and Docker Compose for providing powerful tools that make this project possible.\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkhuda%2Fdockermi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkhuda%2Fdockermi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkhuda%2Fdockermi/lists"}