{"id":15127653,"url":"https://github.com/bytebaker/runlike-rs","last_synced_at":"2026-01-21T16:02:24.784Z","repository":{"id":257094517,"uuid":"855480432","full_name":"ByteBaker/runlike-rs","owner":"ByteBaker","description":"Given an existing docker container, prints the command line necessary to run a copy of it.","archived":false,"fork":false,"pushed_at":"2024-10-04T23:25:28.000Z","size":17,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-30T17:31:05.356Z","etag":null,"topics":["docker","docker-container","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/ByteBaker.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":"2024-09-10T23:57:03.000Z","updated_at":"2024-12-30T22:30:25.000Z","dependencies_parsed_at":"2024-09-14T20:45:56.125Z","dependency_job_id":"cd044afd-149d-4cd9-8792-b1078927db1b","html_url":"https://github.com/ByteBaker/runlike-rs","commit_stats":null,"previous_names":["bytebaker/runlike-rs"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByteBaker%2Frunlike-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByteBaker%2Frunlike-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByteBaker%2Frunlike-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByteBaker%2Frunlike-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ByteBaker","download_url":"https://codeload.github.com/ByteBaker/runlike-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237784860,"owners_count":19365944,"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-container","rust"],"created_at":"2024-09-26T02:05:12.454Z","updated_at":"2025-10-23T06:30:19.907Z","avatar_url":"https://github.com/ByteBaker.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"#### Runlike, (re)written in Rust\n\n    \"See this docker container? I wish I could run another one just like it,\n    but I'll be damned if I'm going to type all those command-line switches manually!\"\n\nThis is what `runlike` does. You give it a docker container, it outputs the command line necessary to run another one just like it, including the arguments that went while creating it. It's a real time saver for those that normally deploy their docker containers via some CM tool like Ansible/Chef and then find themselves needing to manually re-run some container.\n\n#### The Rust appeal\nThe two primary benefits that come with using `runlike-rs` are:\n1. It's at least 70% faster than its Python counterpart.\n2. It comes as a single, compiled binary. No Python runtime required.\n\n# Usage\n    runlike \u003ccontainer-name\u003e\nThis prints out what you need to run to get a similar container. You can do `$(runlike container-name)` to simply execute its output in one step.\n\n`-p` breaks the command line down to nice, pretty lines. For example:\n\n    $ runlike -p redis\n\n    docker run \\\n        --name=redis \\\n        -e \"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\" \\\n        -e \"REDIS_VERSION=2.8.9\" \\\n        -e \"REDIS_DOWNLOAD_URL=http://download.redis.io/releases/redis-2.8.9.tar.gz\" \\\n        -e \"REDIS_DOWNLOAD_SHA1=003ccdc175816e0a751919cf508f1318e54aac1e\" \\\n        -p 0.0.0.0:6379:6379/tcp \\\n        --detach=true \\\n        myrepo/redis:7860c450dbee9878d5215595b390b9be8fa94c89 \\\n        redis-server --slaveof 172.31.17.84 6379\n\nFeeding it the output of `docker inspect` also works:\n\n```\ndocker inspect \u003ccontainer-name\u003e | runlike --stdin\n```\n\n`--no-name` will omit the container name from the output (to avoid collisions).\n\n\n# Status\n\nThis is very much a work in progress. Many `docker run` options aren't yet supported, but the most commonly used ones are. Feel free to send pull requests if you add any or if you happen to fix any (of the many) bugs this package undoubtedly has.\n\nProbably **shouldn't use this in production** yet. If you do, double check that it's actually running what you want it to run.\n\n## Supported Run Options\n\n```\n      --add-host list                  Add a custom host-to-IP mapping\n                                       (host:ip)\n      --cap-add list                   Add Linux capabilities\n      --cap-drop list                  Drop Linux capabilities\n      --cpuset-cpus string             CPUs in which to allow execution\n                                       (0-3, 0,1)\n      --cpuset-mems string             MEMs in which to allow execution\n  -d, --detach                         Run container in background and\n                                       print container ID\n      --device list                    Add a host device to the container\n      --dns list                       Set custom DNS servers\n  -e, --env list                       Set environment variables\n      --entrypoint string              Overwrite the default ENTRYPOINT\n      --expose list                    Expose a port or a range of ports\n  -h, --hostname string                Container host name\n  -l, --label list                     Set meta data on a container\n      --log-driver string              Logging driver for the container\n      --log-opt list                   Log driver options\n      --mac-address string             Container MAC address (e.g.,\n                                       92:d0:c6:0a:29:33)\n  -m, --memory bytes                   Memory limit\n      --memory-reservation bytes       Memory soft limit\n      --name string                    Assign a name to the container\n      --network string                 Connect a container to a network\n                                       (default \"default\")\n      --pid string                     PID namespace to use\n      --privileged                     Give extended privileges to this\n                                       container\n  -p, --publish list                   Publish a container's port(s) to\n                                       the host\n      --restart string                 Restart policy to apply when a\n                                       container exits (default \"no\")\n      --rm                             Automatically remove the container\n                                       when it exits\n      --runtime string                 Runtime to use for this container\n  -t, --tty                            Allocate a pseudo-TTY\n  -u, --user string                    Username or UID (format:\n                                       \u003cname|uid\u003e[:\u003cgroup|gid\u003e])\n  -v, --volume list                    Bind mount a volume\n      --volumes-from list              Mount volumes from the specified\n                                       container(s)\n  -w, --workdir string                 Working directory inside the container\n```\n\n## Installation Instructions\nJust download the binary from releases and you're good to go. Or run the following commands:\n```bash\n# For Linux\nwget -O /tmp/runlike https://github.com/ByteBaker/runlike-rs/releases/latest/download/runlike-linux-amd64 \u0026\u0026 sudo mv /tmp/runlike /usr/local/bin/runlike \u0026\u0026 sudo chmod +x /usr/local/bin/runlike\n\n# For MacOS\nwget -O /tmp/runlike https://github.com/ByteBaker/runlike-rs/releases/latest/download/runlike-macos-amd64 \u0026\u0026 sudo mv /tmp/runlike /usr/local/bin/runlike \u0026\u0026 sudo chmod +x /usr/local/bin/runlike\n\n```\n\n## Not Yet Supported Run Options (PRs are most welcome!)\nEverything not present in the list. But work is in progress.\n\n## Roadmap:\n- [ ] Support more flags\n- [x] Installation instructions\n- [x] Setup CI and release binaries\n- [ ] Run without installation\n\n## Footnote\nThe work here is based on [Assaf Lavie](https://assaf.io)'s [runlike](https://github.com/lavie/runlike). I was lazy so the README is mostly a ripoff too. It's still a work in progress, and some features aren't yet supported. But we'll get there, sooner than later.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytebaker%2Frunlike-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbytebaker%2Frunlike-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytebaker%2Frunlike-rs/lists"}