{"id":15676108,"url":"https://github.com/hectorm/docker-bulk","last_synced_at":"2025-03-30T06:27:50.392Z","repository":{"id":79297843,"uuid":"600773173","full_name":"hectorm/docker-bulk","owner":"hectorm","description":"Perform bulk actions on Docker resources.","archived":false,"fork":false,"pushed_at":"2024-07-20T15:55:06.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-21T00:11:10.427Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","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/hectorm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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},"funding":{"github":"hectorm","custom":"https://hector.molinero.dev/donate"}},"created_at":"2023-02-12T15:01:52.000Z","updated_at":"2024-07-20T15:55:09.000Z","dependencies_parsed_at":"2024-10-23T12:38:24.263Z","dependency_job_id":null,"html_url":"https://github.com/hectorm/docker-bulk","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"1af546c6417517baa7cce30c2e2ec440e2200531"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hectorm%2Fdocker-bulk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hectorm%2Fdocker-bulk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hectorm%2Fdocker-bulk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hectorm%2Fdocker-bulk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hectorm","download_url":"https://codeload.github.com/hectorm/docker-bulk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246285654,"owners_count":20752947,"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":[],"created_at":"2024-10-03T16:01:20.437Z","updated_at":"2025-03-30T06:27:50.374Z","avatar_url":"https://github.com/hectorm.png","language":"Shell","funding_links":["https://github.com/sponsors/hectorm","https://hector.molinero.dev/donate"],"categories":[],"sub_categories":[],"readme":"# docker bulk\n\nPerform bulk actions on Docker resources.\n\n## Installation\n\n### Requirements\n * [`jq`](https://stedolan.github.io/jq/) `1.6+`\n\n### Current user\n\n```sh\n[ -n \"$DOCKER_CONFIG\" ] || export DOCKER_CONFIG=\"$HOME\"/.docker; mkdir -p \"$DOCKER_CONFIG\"/cli-plugins\ncurl --proto '=https' --tlsv1.3 -o \"$DOCKER_CONFIG\"/cli-plugins/docker-bulk 'https://raw.githubusercontent.com/hectorm/docker-bulk/v0.0.1/docker-bulk'\nchmod +x \"$DOCKER_CONFIG\"/cli-plugins/docker-bulk\n```\n\n### System-wide\n\n```sh\nsudo mkdir -p /usr/local/lib/docker/cli-plugins\nsudo curl --proto '=https' --tlsv1.3 -o /usr/local/lib/docker/cli-plugins/docker-bulk 'https://raw.githubusercontent.com/hectorm/docker-bulk/v0.0.1/docker-bulk'\nsudo chmod +x /usr/local/lib/docker/cli-plugins/docker-bulk\n```\n\n## Usage\n\n```sh\ndocker bulk RESOURCE FILTER [COMMAND]\n```\n\nThe command is executed with the resource ID as the last argument. If the command is omitted, the resource ID is printed.\n\n\u003e **Note**  \n\u003e `jq` is used to perform the filtering on the JSON specification of the resource, please refer to its [manual](https://stedolan.github.io/jq/manual/) to learn more about the filter syntax.\n\n### Examples\n\n#### Restart unhealthy containers:\n```sh\ndocker bulk container '.State.Status == \"running\" and .State.Health.Status == \"unhealthy\"' docker container restart\n```\n\n#### Restart containers that have the Docker daemon socket mounted:\n```sh\ndocker bulk container '.Mounts[].Source == \"/var/run/docker.sock\"' docker container restart\n```\n\n#### Remove volumes with the prefix `test_` in their name:\n```sh\ndocker bulk volume '.Name | startswith(\"test_\")' docker volume rm\n```\n\n#### List all images:\n```sh\ndocker bulk image '.'\n```\n\n#### List images bigger than 500 MB:\n```sh\ndocker bulk image '.Size \u003e 500 * $MB'\n```\n\n#### List images older than 7 days:\n```sh\ndocker bulk image '.Created | sub(\"[.][0-9]+Z$\"; \"Z\") | fromdate \u003c now - 7 * $DAY'\n```\n\n#### List IPv6 capable networks with the `bridge` driver:\n```sh\ndocker bulk network '.EnableIPv6 == true and .Driver == \"bridge\"'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhectorm%2Fdocker-bulk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhectorm%2Fdocker-bulk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhectorm%2Fdocker-bulk/lists"}