{"id":13588078,"url":"https://github.com/rawkode/zsh-docker-run","last_synced_at":"2025-04-08T02:34:42.514Z","repository":{"id":145305537,"uuid":"93494868","full_name":"rawkode/zsh-docker-run","owner":"rawkode","description":"Run your favourite commands naturally, with Docker","archived":true,"fork":false,"pushed_at":"2017-06-29T12:48:57.000Z","size":9,"stargazers_count":47,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-06T07:40:17.662Z","etag":null,"topics":["docker","docker-image","zsh"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/rawkode.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-06-06T08:30:55.000Z","updated_at":"2024-09-15T21:02:47.000Z","dependencies_parsed_at":"2024-01-03T04:16:39.586Z","dependency_job_id":"52dbf750-b9ed-4635-b208-72fcdb093d31","html_url":"https://github.com/rawkode/zsh-docker-run","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rawkode%2Fzsh-docker-run","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rawkode%2Fzsh-docker-run/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rawkode%2Fzsh-docker-run/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rawkode%2Fzsh-docker-run/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rawkode","download_url":"https://codeload.github.com/rawkode/zsh-docker-run/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247765116,"owners_count":20992241,"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","zsh"],"created_at":"2024-08-01T15:06:29.939Z","updated_at":"2025-04-08T02:34:42.251Z","avatar_url":"https://github.com/rawkode.png","language":"Shell","funding_links":[],"categories":["Plugins","Shell"],"sub_categories":["ZSH on Windows","Zinit (née zplugin)"],"readme":"# zsh-docker-run\n\n## Run commands naturally, forgetting all about Docker\n\nRun commands \"naturally\" without having them installed, using Docker.\n\n### Why?\n\nAs we adopt Docker more, we install a whole lot less on our machines. Instead of installing node, php, ruby - we pull their latest Docker images. This means that simple commands, such as `npm install` and `irb` become more cumbersome, such as:\n\n```shell\ndocker run --rm -it --entrypoint=irb ruby:latest\n```\n\nIt'd be much better if we could work as we used to, keeping our simple commands. Your first thought might be \"use an alias\" ... but we want to be better than that. What if we're inside of a project that's using `docker-compose` and we want to update our node packages?\n\nNormally, this is just `npm update`; but instead, we now need to use `docker-compose run --rm node npm update`\n\n*Using this plugin, we can detect these situations for you*. Go back to using `npm update`. Just add a simple function and call `run_with_docker` :smile:\n\n### How?\n\nInstall this plugin with your favourite zsh plugin manager, I use `zplug`:\n\n```shell\n# For zplug\nzplug \"rawkode/zsh-docker-run\"\n```\n\nNow all you need to-do is add some functions to your `.zshrc` file:\n\n```shell\nfunction example {\n  run_with_docker \"image_name\" \"image_tag\" \"command\" $@\n}\n\nfunction npm {\n  run_with_docker \"node\" \"alpine\" \"npm\" $@\n}\n```\n\n### More Examples\n\n```shell\nfunction elixir() {\n  run_with_docker \"elixir\" \"latest\" \"elixir\" $@\n}\n\nfunction iex() {\n  run_with_docker \"elixir\" \"latest\" \"iex\" $@\n}\n\nfunction mix() {\n  run_with_docker \"elixir\" \"latest\" \"mix\" $@\n}\n\nfunction go() {\n  run_with_docker \"golang\" \"latest\" \"go\" $@\n}\n\nfunction php() {\n  run_with_docker \"php\" \"latest\" \"php\" $@\n}\n```\n\n### What's Next?\n\n- [ ] I'd like to provide a simpler interface, replacing functions with a map?\n- [ ] Possibly provide a bunch of defaults, enabling the more popular commands\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frawkode%2Fzsh-docker-run","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frawkode%2Fzsh-docker-run","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frawkode%2Fzsh-docker-run/lists"}