{"id":22488747,"url":"https://github.com/jjlin/docker-image-extract","last_synced_at":"2026-01-17T17:21:39.975Z","repository":{"id":41995788,"uuid":"260823788","full_name":"jjlin/docker-image-extract","owner":"jjlin","description":"Minimal-dependency shell script to pull and extract all files from an image in Docker Hub","archived":false,"fork":false,"pushed_at":"2023-08-09T05:46:00.000Z","size":41,"stargazers_count":103,"open_issues_count":3,"forks_count":21,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-08-02T21:51:36.938Z","etag":null,"topics":["docker","docker-image","shell","shell-script"],"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/jjlin.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":"2020-05-03T03:51:45.000Z","updated_at":"2025-08-02T20:53:22.000Z","dependencies_parsed_at":"2024-12-06T17:20:46.520Z","dependency_job_id":"63359964-df3f-4ba3-9363-fc14edb67b5d","html_url":"https://github.com/jjlin/docker-image-extract","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jjlin/docker-image-extract","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjlin%2Fdocker-image-extract","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjlin%2Fdocker-image-extract/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjlin%2Fdocker-image-extract/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjlin%2Fdocker-image-extract/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jjlin","download_url":"https://codeload.github.com/jjlin/docker-image-extract/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjlin%2Fdocker-image-extract/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28512604,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"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":["docker","docker-image","shell","shell-script"],"created_at":"2024-12-06T17:18:38.484Z","updated_at":"2026-01-17T17:21:39.946Z","avatar_url":"https://github.com/jjlin.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"The `docker-image-extract` script pulls and extracts all files from an image\nin [Docker Hub](https://hub.docker.com/). For multi-platform images, you can\nchoose the platform-specific image to pull.\n\n`docker-image-extract` has minimal dependencies that should exist in pretty\nmuch any Linux environment, with the possible exception of `curl`/`wget`:\n\n* `curl` or `wget`\n* `find`\n* `grep`\n* `gzip`\n* `mkdir`\n* `rm`\n* `sed`\n* `sh`\n* `tar`\n\nIf you are using [BusyBox](https://busybox.net/), version 1.34.0 or later is\nrequired, as the `wget` implementation in earlier versions does not recognize\nthe HTTP 307/308 redirects returned by Docker Hub.\n\n## Usage\n\n```\n./docker-image-extract [OPTIONS...] IMAGE[:REF]\n\nIMAGE can be a community user image (like 'some-user/some-image') or a\nDocker official image (like 'hello-world', which contains no '/').\n\nREF is either a tag name or a full SHA-256 image digest (with a 'sha256:' prefix).\nThe default ref is the 'latest' tag.\n\nOptions:\n\n  -p PLATFORM  Pull image for the specified platform (default: linux/amd64)\n               For a given image on Docker Hub, the 'Tags' tab lists the\n               platforms supported for that image.\n  -o OUT_DIR   Extract image to the specified output dir (default: ./output)\n  -h           Show help with usage examples\n\nExamples:\n\n# Pull and extract all files in the 'hello-world' image tagged 'latest'.\n$ ./docker-image-extract hello-world:latest\n\n# Same as above; ref defaults to the 'latest' tag.\n$ ./docker-image-extract hello-world\n\n# Pull the 'hello-world' image for the 'linux/arm64/v8' platform.\n$ ./docker-image-extract -p linux/arm64/v8 hello-world\n\n# Pull an image by digest.\n$ ./docker-image-extract hello-world:sha256:90659bf80b44ce6be8234e6ff90a1ac34acbeb826903b02cfa0da11c82cbc042\n```\n\n## Sample output\n\n```\n$ ./docker-image-extract busybox:musl\nGetting API token...\nGetting image manifest for library/busybox:musl...\nFetching and extracting layer e4df39e4f349fc83694349a5a94afc8d9857fa66f7421427f3d2463a58d876d3...\nImage contents extracted into ./output.\n$ ls output\nbin  dev  etc  home  root  tmp  usr  var\n$ ls -l output/bin/{busybox,ls}\n-rwx------ 393 jjlin users 1148648 Apr  7 13:18 output/bin/busybox\n-rwx------ 393 jjlin users 1148648 Apr  7 13:18 output/bin/ls\n```\n\n## See also\n\n* https://rmannibucau.metawerx.net/post/docker-extracts-fileystem-with-bash\n\n  The logic in this script is based on this blog post, but pretty much\n  everything has been rewritten and improved.\n\n* https://github.com/moby/moby/blob/master/contrib/download-frozen-image-v2.sh\n\n  This script downloads the layers of a Docker image in a form suitable for use\n  with [`docker load`](https://docs.docker.com/engine/reference/commandline/load/).\n  It doesn't actually extract the layers, though.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjlin%2Fdocker-image-extract","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjjlin%2Fdocker-image-extract","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjlin%2Fdocker-image-extract/lists"}