{"id":13644876,"url":"https://github.com/aidanhs/dlgrab","last_synced_at":"2025-08-09T05:06:41.081Z","repository":{"id":27380010,"uuid":"30855836","full_name":"aidanhs/dlgrab","owner":"aidanhs","description":"docker layer grabber","archived":false,"fork":false,"pushed_at":"2018-02-03T18:40:39.000Z","size":34,"stargazers_count":80,"open_issues_count":0,"forks_count":13,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-24T16:10:05.459Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aidanhs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-16T05:55:32.000Z","updated_at":"2024-08-06T13:55:29.000Z","dependencies_parsed_at":"2022-08-20T07:50:13.586Z","dependency_job_id":null,"html_url":"https://github.com/aidanhs/dlgrab","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/aidanhs%2Fdlgrab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aidanhs%2Fdlgrab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aidanhs%2Fdlgrab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aidanhs%2Fdlgrab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aidanhs","download_url":"https://codeload.github.com/aidanhs/dlgrab/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225669561,"owners_count":17505386,"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-08-02T01:02:17.598Z","updated_at":"2024-11-21T03:56:38.832Z","avatar_url":"https://github.com/aidanhs.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# DLGrab (docker layer grab)\n\n## Requirements\n\nYou need to have docker running on your local machine. Remote daemons won't\nwork, though it wouldn't be hard to add them.\n\n## Caveats\n\nDLGrab shims the api endpoints docker touches when pushing an image. If\nDocker starts expecting different responses from these endpoints, DLGrab may\nstop working.\n\nThat said, it's probably more robust than trying to export directly from the\nfilesystem.\n\n## Get dlgrab\n\nBuild:\n\n    $ git clone https://github.com/aidanhs/dlgrab.git\n    $ cd dlgrab\n    $ make\n    $ ./dlgrab\n\nDownload:\n\n    $ wget -O dlgrab https://github.com/aidanhs/dlgrab/releases/download/0.2/dlgrab-linux-x64\n    $ ./dlgrab\n\nDocker pull:\n\n    $ IMG=aidanhs/dlgrab:0.2\n    $ docker pull $IMG\n    $ alias dlgrab='docker run --rm -v $(pwd):/out -v /var/run/docker.sock:/var/run/docker.sock $IMG\n    $ dlgrab\n\n## Usage\n\n    $ ./dlgrab\n    Usage for ./dlgrab [flags...] LAYER\n      LAYER: layer id to export, or image name to export top layer of\n      --clean=false              Remove the temporary tag after use\n                                   WARNING: can trigger layer deletion if run on a layer with no children or other references\n      --debug=false              Set log level to debug\n      -h, --help=false           Print this help text\n      -o, --outdir=\".\"           Directory to write layer to\n      --registry-format=false    Output in the format a registry would use, rather than for an image export\n    \n      The DOCKER_HOST environment variable overrides the default location to find the docker daemon\n\nExporting a single layer:\n\n    $ docker history ubuntu:14.04\n    IMAGE               CREATED             CREATED BY                                      SIZE\n    5ba9dab47459        2 weeks ago         /bin/sh -c #(nop) CMD [/bin/bash]               0 B\n    51a9c7c1f8bb        2 weeks ago         /bin/sh -c sed -i 's/^#\\s*\\(deb.*universe\\)$/   1.895 kB\n    5f92234dcf1e        2 weeks ago         /bin/sh -c echo '#!/bin/sh' \u003e /usr/sbin/polic   194.5 kB\n    27d47432a69b        2 weeks ago         /bin/sh -c #(nop) ADD file:62400a49cced0d7521   188.1 MB\n    511136ea3c5a        20 months ago                                                       0 B\n    $ ./dlgrab --clean 51a9c7c1f8bb # this layer is referenced by child images, so --clean is fine\n    Full layer id found: 51a9c7c1f8bb2fa19bcd09789a34e63f35abb80044bc10196e304f6634cc582c\n    Layer folder will be dumped into .\n    Writing file: json\n    Writing file: layer.tar\n    Export complete\n    $ ls 51a9c7c1f8bb2fa19bcd09789a34e63f35abb80044bc10196e304f6634cc582c\n    json  layer.tar  VERSION\n    $ tar tf 51a9c7c1f8bb2fa19bcd09789a34e63f35abb80044bc10196e304f6634cc582c/layer.tar \n    etc/\n    etc/apt/\n    etc/apt/sources.list\n\nLoading an image built with individually exported layers:\n\n    $ cd $(mktemp -d)\n    /tmp/tmp.R433Vilvoa $ docker history centos:6.6\n    IMAGE               CREATED             CREATED BY                                      SIZE\n    77e369743e24        9 days ago          /bin/sh -c #(nop) ADD file:f10753ca9b3793921c   202.6 MB\n    5b12ef8fd570        4 months ago        /bin/sh -c #(nop) MAINTAINER The CentOS Proje   0 B\n    511136ea3c5a        20 months ago                                                       0 B\n    /tmp/tmp.R433Vilvoa $ dlgrab --clean 77e369743e24\n    Full layer id found: 77e369743e242d5b13f6426b128b1609f8aa1091b935e50b0de81c8bc3e1510d\n    Layer folder will be dumped into .\n    Writing file: json\n    Writing file: layer.tar\n    Export complete\n    /tmp/tmp.R433Vilvoa $ dlgrab --clean 5b12ef8fd570\n    Full layer id found: 5b12ef8fd57065237a6833039acc0e7f68e363c15d8abb5cacce7143a1f7de8a\n    Layer folder will be dumped into .\n    Writing file: json\n    Writing file: layer.tar\n    Export complete\n    /tmp/tmp.R433Vilvoa $ dlgrab --clean 511136ea3c5a\n    Full layer id found: 511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158\n    Layer folder will be dumped into .\n    Writing file: json\n    Writing file: layer.tar\n    Export complete\n    /tmp/tmp.R433Vilvoa $ docker rmi centos:6.6\n    Untagged: centos:6.6\n    Deleted: 77e369743e242d5b13f6426b128b1609f8aa1091b935e50b0de81c8bc3e1510d\n    Deleted: 5b12ef8fd57065237a6833039acc0e7f68e363c15d8abb5cacce7143a1f7de8a\n    /tmp/tmp.R433Vilvoa $ tar cf img.tar *\n    /tmp/tmp.R433Vilvoa $ tar tf img.tar\n    511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158/\n    511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158/json\n    511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158/VERSION\n    511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158/layer.tar\n    5b12ef8fd57065237a6833039acc0e7f68e363c15d8abb5cacce7143a1f7de8a/\n    5b12ef8fd57065237a6833039acc0e7f68e363c15d8abb5cacce7143a1f7de8a/json\n    5b12ef8fd57065237a6833039acc0e7f68e363c15d8abb5cacce7143a1f7de8a/VERSION\n    5b12ef8fd57065237a6833039acc0e7f68e363c15d8abb5cacce7143a1f7de8a/layer.tar\n    77e369743e242d5b13f6426b128b1609f8aa1091b935e50b0de81c8bc3e1510d/\n    77e369743e242d5b13f6426b128b1609f8aa1091b935e50b0de81c8bc3e1510d/json\n    77e369743e242d5b13f6426b128b1609f8aa1091b935e50b0de81c8bc3e1510d/VERSION\n    77e369743e242d5b13f6426b128b1609f8aa1091b935e50b0de81c8bc3e1510d/layer.tar\n    /tmp/tmp.R433Vilvoa $ docker load -i img.tar\n    /tmp/tmp.R433Vilvoa $ docker run -it 77e369743e24 bash\n    [root@4b899c017d55 /]# cat /etc/issue\n    CentOS release 6.6 (Final)\n    Kernel \\r on an \\m\n    \n    [root@4b899c017d55 /]#\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faidanhs%2Fdlgrab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faidanhs%2Fdlgrab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faidanhs%2Fdlgrab/lists"}