{"id":28695968,"url":"https://github.com/creasty/rid","last_synced_at":"2025-06-14T09:09:08.414Z","repository":{"id":57527613,"uuid":"84824210","full_name":"creasty/rid","owner":"creasty","description":"Run commands in container as if were native. Stress-free dockerized development environment finally arrived","archived":false,"fork":false,"pushed_at":"2020-10-11T18:35:22.000Z","size":65,"stargazers_count":57,"open_issues_count":8,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-11T07:53:59.279Z","etag":null,"topics":["container","development","development-environment","docker","docker-compose"],"latest_commit_sha":null,"homepage":"","language":"Go","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/creasty.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}},"created_at":"2017-03-13T12:31:40.000Z","updated_at":"2024-01-30T02:36:33.000Z","dependencies_parsed_at":"2022-09-18T04:40:15.989Z","dependency_job_id":null,"html_url":"https://github.com/creasty/rid","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/creasty/rid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creasty%2Frid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creasty%2Frid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creasty%2Frid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creasty%2Frid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/creasty","download_url":"https://codeload.github.com/creasty/rid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creasty%2Frid/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259790462,"owners_count":22911549,"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":["container","development","development-environment","docker","docker-compose"],"created_at":"2025-06-14T09:09:07.810Z","updated_at":"2025-06-14T09:09:08.408Z","avatar_url":"https://github.com/creasty.png","language":"Go","readme":"![](https://user-images.githubusercontent.com/1695538/37242202-ae2872d2-24a8-11e8-81f7-95caf8f77a77.png)\n\n\nrid (run-in-docker)\n===================\n\n[![Build Status](https://travis-ci.org/creasty/rid.svg?branch=master)](https://travis-ci.org/creasty/rid)\n[![codecov](https://codecov.io/gh/creasty/rid/branch/master/graph/badge.svg)](https://codecov.io/gh/creasty/rid)\n[![GoDoc](https://godoc.org/github.com/creasty/rid?status.svg)](https://godoc.org/github.com/creasty/rid)\n[![GitHub release](https://img.shields.io/github/release/creasty/rid.svg)](https://github.com/creasty/rid/releases)\n[![License](https://img.shields.io/github/license/creasty/rid.svg)](./LICENSE)\n\nRun commands in container as if were native. Stress-free dockerized development environment finally arrived.\n\n\nWhat is rid?\n------------\n\nWith a `rid/` directory at the root of a project, any command prefixed by `rid` is executed within a Docker container.\n\n```hcl\n$ ls ./rid\nconfig.yml\ndocker-compose.yml\nDockerfile\n```\n\nThat is to say, even if your environment is absolutely clean and you have nothing but `docker`, `docker-compose` and `rid`, getting started with a new Rails project from scratch has never been easier.\n\n```hcl\n# install dependencies and setup a database\n$ rid cp .env{.sample,}\n$ rid bundle install --path vendor/bundle\n$ rid rake db:create\n$ rid rake db:schema:load\n\n# start a server\n$ rid rails s\n```\n\n\nInstallation\n------------\n\nFirst, install [Docker](https://docs.docker.com/engine/installation/) and [Docker Compose](https://docs.docker.com/compose/install/).\nThe easiest way to do this on macOS is by installing [Docker for Mac](https://docs.docker.com/docker-for-mac/).\n\n### macOS\n\nYou can install `rid` via Homebrew:\n\n```hcl\n$ brew install creasty/tools/rid\n```\n\n### Linux\n\nDownload a binary from here: https://github.com/creasty/rid/releases\n\n### Windows\n\nNot supported yet\n\n\nUsage\n-----\n\n`rid` is a project contextual tool, meaning that it's aware of working directory and automatically finds the root directory of a project by locating a configuration file.\n\nTypical `rid` directory looks like this:\n\n```hcl\nrid/                   # rid directory at the root of a project (e.g., same level as `.git`'s)\n  libexec/             # custom sub-commands for rid\n  config.yml           # configuration file for rid\n  docker-compose.yml   # docker-compose manifest\n  Dockerfile           # dockerfile\n```\n\nNote that `rid/config.yml` and `rid/docker-compose.yml` are regardlessly required for `rid` to work with.\n\n### Config file\n\nConfigurable parameters of `rid/config.yml` are the following.\n\n```go\ntype Config struct {\n\t// ProjectName is used for `docker-compose` in order to distinguish projects in other locations\n\tProjectName string `json:\"project_name\" valid:\"required\"`\n\n\t// MainService is a service name in `docker-compose.yml`, in which container commands given to rid are executed\n\t// Default is \"app\"\n\tMainService string `json:\"main_service\"`\n}\n```\n\n### Custom commands\n\nExecutables in `rid/libexec/` can be run as a sub command.\n\n```hcl\nrid/libexec/\n  foo           # `rid foo` -- this is executed in a container\n  rid-bar       # `rid bar` -- name starts with `rid-` is executed on a host computer\n  rid-bar.txt   # optionally, placing `.txt` file that shares the common basename enables \"help\" functionality\n```\n\nHelp file should have a title in the first line:\n\n```\nShow greeting message\n\nUsage:\n    rid bar NAME\n```\n\nThe title (first line) appears on the help of `rid`.\n\n```hcl\n$ rid\nExecute commands via docker-compose\n\nUsage:\n    rid COMMAND [args...]\n    rid COMMAND -h|--help\n    rid [options]\n\nOptions:\n    -h, --help     Show this\n    -v, --version  Show rid version\n        --debug    Debug context and configuration\n\nCommands:\n    compose  # Execute docker-compose\n    foo\n    bar      # Show greeting message\n```\n\nAnd `rid COMMAND -h` prints the full contents.\n\n```\n$ rid bar -h\nShow greeting message\n\nUsage:\n    rid bar NAME\n```\n\n\nDevelopment\n-----------\n\nSurprise surprise, `rid` itself is developed by `rid`!\n\n```hcl\n$ rid glide install  # install dependencies\n$ rid make test      # run lint and tests\n$ rid make           # compile for darwin/amd64\n$ ./bin/rid -v       # execute a new binary\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreasty%2Frid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcreasty%2Frid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreasty%2Frid/lists"}