{"id":19383933,"url":"https://github.com/docspring/docker_merge","last_synced_at":"2026-04-22T09:01:19.322Z","repository":{"id":66068860,"uuid":"219180780","full_name":"DocSpring/docker_merge","owner":"DocSpring","description":"Merge layers from multiple Docker images into a single image (using skopeo)","archived":false,"fork":false,"pushed_at":"2019-11-04T17:06:27.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-13T03:25:56.219Z","etag":null,"topics":[],"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/DocSpring.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-02T16:26:03.000Z","updated_at":"2019-11-04T17:06:29.000Z","dependencies_parsed_at":"2023-03-28T01:03:57.571Z","dependency_job_id":null,"html_url":"https://github.com/DocSpring/docker_merge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DocSpring/docker_merge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DocSpring%2Fdocker_merge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DocSpring%2Fdocker_merge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DocSpring%2Fdocker_merge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DocSpring%2Fdocker_merge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DocSpring","download_url":"https://codeload.github.com/DocSpring/docker_merge/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DocSpring%2Fdocker_merge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32128704,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T08:34:57.708Z","status":"ssl_error","status_checked_at":"2026-04-22T08:34:55.583Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-10T09:28:26.538Z","updated_at":"2026-04-22T09:01:19.303Z","avatar_url":"https://github.com/DocSpring.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Merge\n\nA Ruby script that merges the unique layers from multiple Docker images into a single image.\n\n## Why?\n\n[Multi-stage builds](https://docs.docker.com/develop/develop-images/multistage-build/) can be really useful, but sometimes you need a bit more flexibility. Docker layers are \"content-addressable\", so the order doesn't really matter.\n\nThe `docker_merge` tool allows you to specify a re-usable cache directory, so you only need to update (and upload) any layers that have actually changed. This allows you to split up your Dockerfile into different components, and achieve much more powerful and flexible caching (while also using Docker's built-in caching.)\n\n## Installation\n\n```\ngem install docker_merge\n```\n\n## Requirements\n\n* Ruby\n* [Skopeo](https://github.com/containers/skopeo)\n\n## Usage\n\n```\ndocker_merge -t \u003cmerged_tag\u003e \u003cinput_tag_1\u003e \u003cinput_tag_2\u003e ...\n```\n\n## Gotchas\n\nIf you're building your Docker images locally, then image digests are not computed until the image is pushed. (See: https://github.com/docker/cli/issues/728)\n\nThe `skopeo` tool can only refer to images via tags or digests, so if the digests are missing, then you must refer to your images by tags.\n\n## Additional Context\n\nThe config and manifest are taken from the first input image. The layers and history are modified to include all of the unique layers from the other images.\n\n## References\n\n* [A Peek into Docker Images](https://medium.com/tenable-techblog/a-peek-into-docker-images-b4d6b2362eb)\n* [Accessing Docker Container File system from Mac OS host](http://www.vivekjuneja.in/tips/2016/12/02/docker-1.12.3-view-host-fs/)\n\n## Related Projects\n\n* [PowerShell-RegistryDocker](https://github.com/nicholasdille/PowerShell-RegistryDocker)\n  * [How to Reduce the Build Time of a Monolithic #Docker Image](https://dille.name/blog/2018/08/19/how-to-reduce-the-build-time-of-a-monolithic-docker-image/)\n  * [How to Automate the Merging of Layers from #Docker Images in #PowerShell](https://dille.name/blog/2018/09/07/how-to-automate-the-merging-of-layers-from-docker-images-in-powershell/)\n\n## Development Notes (Mac)\n\n* How to check the docker daemon logs inside the docker VM:\n\n1. Start a new container and mount the VM filesystem\n\n```\ndocker run --rm -it --privileged --pid=host -v /:/vm-root debian:stretch bash\n```\n\n2. Tail the logs\n\n```\ntail -f /vm-root/var/log/docker.log\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocspring%2Fdocker_merge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdocspring%2Fdocker_merge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocspring%2Fdocker_merge/lists"}