{"id":15288865,"url":"https://github.com/karolyp/docker-tar-pusher","last_synced_at":"2025-04-13T08:11:26.710Z","repository":{"id":57214026,"uuid":"371837268","full_name":"karolyp/docker-tar-pusher","owner":"karolyp","description":"Push tar images into Docker registry from NodeJS without using the Docker Engine.","archived":false,"fork":false,"pushed_at":"2024-12-17T15:25:14.000Z","size":434,"stargazers_count":7,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T00:05:16.629Z","etag":null,"topics":["docker","docker-image","docker-registry","docker-registry-v2","docker-tar"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/karolyp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-28T23:12:38.000Z","updated_at":"2025-03-13T01:48:44.000Z","dependencies_parsed_at":"2022-08-29T02:10:52.832Z","dependency_job_id":null,"html_url":"https://github.com/karolyp/docker-tar-pusher","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karolyp%2Fdocker-tar-pusher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karolyp%2Fdocker-tar-pusher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karolyp%2Fdocker-tar-pusher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karolyp%2Fdocker-tar-pusher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karolyp","download_url":"https://codeload.github.com/karolyp/docker-tar-pusher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248681491,"owners_count":21144700,"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":["docker","docker-image","docker-registry","docker-registry-v2","docker-tar"],"created_at":"2024-09-30T15:53:53.306Z","updated_at":"2025-04-13T08:11:26.680Z","avatar_url":"https://github.com/karolyp.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker-tar-pusher\n\n[![build](https://github.com/karolyp/docker-tar-pusher/actions/workflows/node.js.yml/badge.svg)](https://github.com/karolyp/docker-tar-pusher/actions/workflows/node.js.yml)\n\nWith this library you can push tar Docker images directly to a Docker registry without the need of having them loaded\ninto the Docker Engine, re-tagging and pushing.\n\nThe library uses [chunked upload](https://docs.docker.com/registry/spec/api/#pushing-an-image) to push the layers.\n\nSupports HTTP Basic auth.\n\n## How to use\n\nFirst, you have to create a configuration object with the following properties:\n\n- registryUrl: address of the registry\n- tarball: absolute path to tar file\n- chunkSize (optional): size of chunks, defaults to 10 MiB (10 \\* 1024 \\* 1024)\n- logger (optional): specify custom applicationLogger, defaults to console.log\n- sslVerify (optional): should reject invalid TLS certificates, defaults to true\n- auth (optional): HTTP Basic auth containing the username and password, defaults to empty\n- image (optional): image name and version, defaults to empty\n\nThen, you can create a new instance of the `DockerTarPusher` class with the configuration object.\nAfter that, you can call the `pushToRegistry` method to start the upload process.\n\n### Clean-up\n\nAfter a successful upload, the library will take care about cleaning up the temporary files that have been created\nduring the process.\nHowever, you might want to call this clean-up function on in one of your shutdown hooks in order to remove\nany leftovers in case the application exists unexpectedly.\n\n## Examples\n\n### Quickstart\n\n```typescript\nimport { DockerTarPusher, DockerTarPusherOptions } from 'docker-tar-pusher';\n\nconst options: DockerTarPusherOptions = {\n  registryUrl: 'http://localhost:5000',\n  tarball: 'path/to/file.tar'\n};\nconst dockerTarPusher = new DockerTarPusher(options);\n\nawait dockerTarPusher.pushToRegistry();\n```\n\n### Complete example with custom logger\n\n```typescript\nimport { DockerTarPusher, DockerTarPusherOptions, Logger } from 'docker-tar-pusher';\n\nconst myLogger: Logger = {\n  error: (msg: string): void =\u003e {\n    console.log(`[ERROR] ${msg}`);\n  },\n  warn: (msg: string): void =\u003e {\n    console.log(`[WARN] ${msg}`);\n  },\n  info: (msg: string): void =\u003e {\n    console.log(`[INFO] ${msg}`);\n  },\n  debug: (msg: string): void =\u003e {\n    console.log(`[DEBUG] ${msg}`);\n  }\n};\n\nconst options: DockerTarPusherOptions = {\n  registryUrl: 'http://localhost:5000',\n  tarball: 'path/to/file.tar',\n  chunkSize: 8 * 1024 * 1024,\n  applicationLogger: myLogger,\n  sslVerify: false,\n  auth: {\n    username: 'testuser',\n    password: 'testpassword'\n  },\n  image: {\n    name: 'my-image',\n    version: '1.2.3'\n  }\n};\nconst dockerTarPusher = new DockerTarPusher(options);\n\n// Attaching clean-up logic to shutdown hook\nprocess.on('SIGINT', () =\u003e {\n  dockerTarPusher.cleanUp();\n});\n\n(async () =\u003e {\n  await dockerTarPusher.pushToRegistry();\n})();\n```\n\n## License\n\n[MIT](LICENSE)\n\nInspired by [dockerregistrypusher](https://github.com/Razikus/dockerregistrypusher)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarolyp%2Fdocker-tar-pusher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarolyp%2Fdocker-tar-pusher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarolyp%2Fdocker-tar-pusher/lists"}