{"id":19096534,"url":"https://github.com/sapcc/docker-image-patcher","last_synced_at":"2026-02-18T18:31:18.682Z","repository":{"id":41954554,"uuid":"430753015","full_name":"sapcc/docker-image-patcher","owner":"sapcc","description":"Patch a Docker image with git/patch files from commandline","archived":false,"fork":false,"pushed_at":"2025-01-23T10:15:16.000Z","size":25,"stargazers_count":3,"open_issues_count":3,"forks_count":0,"subscribers_count":46,"default_branch":"main","last_synced_at":"2025-04-30T14:16:44.595Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sapcc.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,"zenodo":null}},"created_at":"2021-11-22T15:03:57.000Z","updated_at":"2025-03-31T12:56:39.000Z","dependencies_parsed_at":"2024-10-17T23:44:43.439Z","dependency_job_id":"d0747c4c-9234-4c17-a149-701406dea8e4","html_url":"https://github.com/sapcc/docker-image-patcher","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sapcc/docker-image-patcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sapcc%2Fdocker-image-patcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sapcc%2Fdocker-image-patcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sapcc%2Fdocker-image-patcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sapcc%2Fdocker-image-patcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sapcc","download_url":"https://codeload.github.com/sapcc/docker-image-patcher/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sapcc%2Fdocker-image-patcher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29589441,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T16:55:40.614Z","status":"ssl_error","status_checked_at":"2026-02-18T16:55:37.558Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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-09T03:37:00.146Z","updated_at":"2026-02-18T18:31:18.665Z","avatar_url":"https://github.com/sapcc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Image Patcher\nThe Docker Image Patcher with its command `docker-image-patch` is a tool to take an existing\nDocker image, apply a patchset onto it and then rebuild a new image off of this. Patches can\neither be supplied in `.patch` file format or can be generated from a git repository.\n\n## Installation\nAs usual, python3 required, virtualenv recommended. Make sure your pip is a python3-pip.\n\n```shell\n$ pip install git+https://github.com/sapcc/docker-image-patcher\n```\n\n## Usage\nYou need at least:\n * the base Docker image that should be patched (`--base-image`)\n * a repository path aka new image name (`--repository`)\n * at least one patch, either as file (`--patch`) or from a git (`--git`)\n\nYou can also add:\n * a list of new tags for the new Docker image (`--tags`)\n\nA patch is defined by a source and a `docker-workdir`. The `docker-workdir` is the path inside\nthe Docker image where the patch can be applied with `git apply` (similar to `patch -p1`). This is\ngenerally the path inside the image where the application is installed that is about to be patched.\n\nWith `--git` a patch can be automatically generated from a local git repository. This option takes\none to three arguments in the format of `[[path/to/git] git-ref] \u003cdocker-workdir\u003e]`. `path/to/git`\nrefers to the path to the git repo and defaults to `.`. `git-ref` can be any git reference, e.g. a\ncommit hash or a range, which will then be given to `git diff` to create the patch. The defaul is\n`HEAD`, which will result in a patch with all uncommited changes.\n\n`--patch` takes a list of patches that will be applied. Multiple patches can be specified for each\n`--patch`.\n\n`--git` and `--patch` can be used multiple times. The order in which they are supplied matters, as\nthis is also the order the patches are applied in.\n\nOther convenience functions include running commands inside the image via `-c / --run-before` or\n`--run-after` and copying files or directories into the image via `--copy`.\n\n## Examples\nAdd patch `blubb.patch` to image `foo:latest`, resulting in an image `bar:special-fix`:\n```shell\n$ docker-image-patch -b foo:latest -r bar -t special-fix -p blubb.patch /var/lib/my-app/\n```\n\nAdd uncommited changes in local git to image:\n```shell\n$ docker-image-patch -b foo:latest -r bar -t special-fix -g /var/lib/my-app/\n```\n\nAdd a set of commits from the current repository:\n```shell\n$ docker-image-patch -b foo:latest -r bar -t special-fix -g ef69b187..58a94380 /var/lib/my-app/\n```\n\nAdd a set of commits from another repository and a set of patches:\n```shell\n$ docker-image-patch -b foo:latest -r bar -t special-fix -g ~/repos/my-cool-repo/ ef69b187..58a94380 /var/lib/my-app/ -p patches/*.patch /var/lib/my-app/\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsapcc%2Fdocker-image-patcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsapcc%2Fdocker-image-patcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsapcc%2Fdocker-image-patcher/lists"}