{"id":18347635,"url":"https://github.com/ghivert/docker-clone","last_synced_at":"2026-05-05T21:33:17.810Z","repository":{"id":59152975,"uuid":"177354660","full_name":"ghivert/docker-clone","owner":"ghivert","description":"Conform to the Docker Pull format to get all your environment setup in a breeze!","archived":false,"fork":false,"pushed_at":"2019-03-28T13:54:11.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-24T13:36:21.206Z","etag":null,"topics":["cli","docker","git","programmatic"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/ghivert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-24T00:38:15.000Z","updated_at":"2023-02-15T21:47:38.000Z","dependencies_parsed_at":"2022-09-13T11:01:27.980Z","dependency_job_id":null,"html_url":"https://github.com/ghivert/docker-clone","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghivert%2Fdocker-clone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghivert%2Fdocker-clone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghivert%2Fdocker-clone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghivert%2Fdocker-clone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghivert","download_url":"https://codeload.github.com/ghivert/docker-clone/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248127826,"owners_count":21052295,"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","docker","git","programmatic"],"created_at":"2024-11-05T21:14:33.890Z","updated_at":"2026-05-05T21:33:12.767Z","avatar_url":"https://github.com/ghivert.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Clone\n\nDeveloping with micro-services is awesome, but it can be a little boring\nsometimes. Having to setup everything, make the services talking together,\ndatabases properly set, etc.\n\nHappily, Docker comes into play, and completely deals with all your painful\nprocesses. It abstracts everything you need, setup databases for you, creates\na common network, and connect every services together. It’s a huge gain. But\nthis brings a problem: how should you organize your repos? Should you do a\nmono-repo? Multi-repos? And if you do multi-repos, how are you supposed to clone\nall of your GitHub or GitLab repos without having to open every repo, find its\nURL, clone the directory into your workspace, …?\n\nCome Docker Clone!\n\n# Opinions\n\nDocker Clone is opinionated. It expects from you that you’re working with\nmicro-services, and with multi-repos. Multi-repos are better. They’re much\nmore isolated, it forces to decouple by design, it ensures no one can access\ndatabases from other services, and they’re much more easily manageable for one\nperson or a team. You’re just concerned by your repos, and nothing else. Just\ngrab the interfaces of other services, and work on your business logic. That’s\nall.\n\nDocker Clone has been created due to the work on\n[French Pastries](https://frenchpastries.dev). It is made to respond to needs\nof micro-services, mainly made with JavaScript (and JavaScript’s family) and Node.\n\n# How does it work?\n\nDocker Clone uses a file named `docker-clone.yml` to get which repos should be\ncloned, how they should be named, and where they should resides. Usually, it is\nplaced at the root of a directory, as well as a `docker-compose.yml` file to run\neverything once it’s downloaded.\n\nIn correct order, Docker Clone:\n\n1. Fetch the `docker-clone.yml` file.\n2. Determine the correct working directory in which repo-cloning should happen.\n3. Iterate over all the repos, and trigger a `git clone` in the working directory.\n4. Name the repos accordingly to the `docker-clone.yml` file.\n\n# What is the file format?\n\nThe Docker Clone config file is a YAML file, to be coherent with Docker. It is\nsomewhat similar to a `docker-compose.yml`, because it only describes what\nshould be done. The default config file is named `docker-clone.yml`. It is made\nof an optional `working_dir` field at root (initialized at `../` if not set),\nand a `repos` field, containing an array of repo object. A repo is made of two\nfields: an `url` field, and a `name` field. The first one should be either an\nHTTPS or a git address, for git to clone the repo, and a name corresponding to\nthe repo name.\n\n# Example of `docker-clone.yml`\n\n```yaml\nworking_dir: '../' # ../ is the default value for working_dir if not set.\nrepos:\n  - url: git@github.com:ghivert/my-awesome-docker-server.git\n    name: docker-server\n  - url: https://gitlab.com/wolfoxco/my-second-awesome-server.git\n    name: other-docker-server\n```\n\n# Installation\n\nYou can use the `gem` utility to install Docker Clone.\n\n```bash\ngem install docker-clone\n```\n\nYou now have the `docker-clone` command globally installed.\n\n# Usage\n\nDocker Clone is easy to use. Just type `docker-clone` without any argument, and\nit will launch, search for `docker-clone.yml`, and install everything.\n\nYou can use `-h` or `--help` to display help directly. The other option is `-c`,\nor `--config`, followed by a path to the config file. It will be used instead of\n`docker-clone.yml`.\n\nYou can also use a programmatic access. Add the `docker-clone` gem to your `Gemfile`,\nrun a `bundle install`, and you can `require \"docker-clone\"` directly into your\nRuby files. It gives access to a `DockerClone` object.\n\nThe object must be initialized with an options map, with `working_dir` and\n`config_file_path`. Then, run `clone_repos` and it will install everything.\n\n```ruby\nrequire \"docker_clone\"\n\n# Folder structure\n# workspace\n# └── docker-cloner\n#     ├── .git/\n#     ├── .gitignore\n#     ├── docker-clone.yml\n#     ├── docker-compose.yml\n#     └── README.md\n\n# Initialize the object. It reads the config file during initialization.\ncloner = DockerClone.new(\n  working_dir: '../',\n  # working_dir will be expanded to the workspace directory.\n  config_file_path: './docker-clone.yml'\n  # config_file_path will be expanded to docker-clone.yml in the root directory.\n)\n# And clone the repos!\nclone.clone_repos\n```\n\n# Contributions\n\nDo you love the package? Love the utility? Want to improve it? PR are welcome, as\nwell as issues!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghivert%2Fdocker-clone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghivert%2Fdocker-clone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghivert%2Fdocker-clone/lists"}