{"id":16444046,"url":"https://github.com/keens/cargo-pack-docker","last_synced_at":"2025-08-13T05:14:38.564Z","repository":{"id":57537070,"uuid":"82771628","full_name":"KeenS/cargo-pack-docker","owner":"KeenS","description":"a cargo subcommand to package your application into a docker image","archived":false,"fork":false,"pushed_at":"2020-02-19T07:09:33.000Z","size":88,"stargazers_count":19,"open_issues_count":2,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-25T00:01:25.456Z","etag":null,"topics":["cargo","cargo-subcommand","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/KeenS.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-02-22T06:59:00.000Z","updated_at":"2022-04-24T06:05:36.000Z","dependencies_parsed_at":"2022-08-29T00:31:19.472Z","dependency_job_id":null,"html_url":"https://github.com/KeenS/cargo-pack-docker","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/KeenS/cargo-pack-docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeenS%2Fcargo-pack-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeenS%2Fcargo-pack-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeenS%2Fcargo-pack-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeenS%2Fcargo-pack-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KeenS","download_url":"https://codeload.github.com/KeenS/cargo-pack-docker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeenS%2Fcargo-pack-docker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270183606,"owners_count":24541341,"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","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cargo","cargo-subcommand","rust"],"created_at":"2024-10-11T09:23:07.386Z","updated_at":"2025-08-13T05:14:38.508Z","avatar_url":"https://github.com/KeenS.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/KeenS/cargo-pack-docker.svg?branch=master)](https://travis-ci.org/KeenS/cargo-pack-docker)\n[![Build status](https://ci.appveyor.com/api/projects/status/doa9noawxji7uy1v/branch/master?svg=true)](https://ci.appveyor.com/project/KeenS/cargo-pack-docker/branch/master)\n\n\n\n# cargo-pack-docker\nA [`cargo-pack`](https://github.com/KeenS/cargo-pack)er for docker; package your application into a docker image to deploy without Dockerfile\n\nTHIS PRODUCT IS ALPHA STATUS. USE AT YOUR OWN RISK\n# install\n\n## Built binary\n\nsee releases\n\n## building\n\n```\ncargo install cargo-pack-docker\n```\n\n# Usage\n\n```\ncargo pack-docker [-p package] [--release] [TAG]\n# if your configurated tag in Cargo.toml is hoge:0.1.0, the TAG will be hoge\n# if TAG is omitted and you have only one `[[package.metadata.pack.docker]]` section, it will be used\n```\n\n# Configulation\n\n\n``` toml\n# configuration of cargo-pack\n[package.metadata.pack]\ndefault-packers = [\"docker\"]\n# files will be placet to /opt/app\nfiles = [\"README.md\"]\n\n# configuration of cargo-pack-docker\n[[package.metadata.pack.docker]]\n# tag of the created image. Can be omitted.\n# Default to PACKAGE_NAME:latest for debug profile\n# and PACKAGE_NAME:PACKAGE_VERSION for release profile\ntag = \"hoge:0.1.0\"\n# base image of the docker image. Required.\nbase-image = \"ubuntu:16.04\"\n# the bin to include into the docker image.\n# will be placed to /opt/app/bin/\n# can be omitted if the project have only one binary target.\nbin = \"aaa\"\n# `ENTRYPOINT` of Dockerfile. optional.\nentrypoint = [\"aa\", \"bb\"]\n# `CMD` of Dockerfile. optional.\ncmd = [\"c\", \"d\"]\n# inject command into the Dockerfile. optional\ninject = \"\nENV RUST_LOG debug\nRUN apt install libpq-dev\n\"\n\n# you can write another configuration \n[[package.metadata.pack.docker]]\nbase-image = \"ubuntu:16.04\"\nbin = \"bbb\"\n```\n\nwith the first configuration, build a docker image with this Dockerfile content:\n\n```\nFROM ubuntu:16.04\n\nRUN mkdir -p /opt/app/bin\nCOPY README.md /opt/app\nCOPY aaa /opt/app/bin\nWORKDIR /opt/app\n\nENV RUST_LOG debug\nRUN apt install libpq-dev\n\n\nENTRYPOINT [\"aa\", \"bb\"]\nCMD [\"c\", \"d\"]\n\n```\n\n# Running cargo-pack-docker in docker\n\nThere are images\n\n[blackenedgold/cargo-pack-docker](https://hub.docker.com/r/blackenedgold/cargo-pack-docker/)\n.\n\nTo build a docker image using the cargo-pack-docker docker image, run this command.\n\n``` console\ndocker run \\\n  -v /var/run/docker.sock:/var/run/docker.sock \\\n  -v `which docker`:/usr//bin/docker \\\n  -v $(pwd):/tmp/app \\\n  -w /tmp/app\n  blackenedgold/cargo-pack-docker \\\n  cargo pack-docker\n```\n\n\nand if you prefer docker-compose, use this yaml fragment.\n\n``` yaml\n  build:\n    image: blackenedgold/cargo-pack-docker:0.4.0-rust-1.32.0\n    command: cargo pack-docker\n    working_dir: /tmp/app\n    volumes:\n      - ./ /tmp/app\n      - /var/run/docker.sock:/var/run/docker.sock\n      # your path to docker\n      - /usr/bin/docker:/usr/bin/docker\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeens%2Fcargo-pack-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeens%2Fcargo-pack-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeens%2Fcargo-pack-docker/lists"}