Name: rid
Owner: Wantedly, Inc.
Description: Run commands in container as if were native. Stress-free dockerized development environment finally arrived
Forked from: creasty/rid
Created: 2017-10-12 05:52:02.0
Updated: 2017-10-12 05:52:03.0
Pushed: 2017-10-12 07:45:26.0
Size: 64
Language: Go
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Run commands in container as if were native. Stress-free dockerized development environment finally arrived.
With a rid/
directory at the root of a project, any command prefixed by rid
is executed within a Docker container.
./rid
ig.yml
er-compose.yml
erfile
That 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.
stall dependencies and setup a database
d cp .env{.sample,}
d bundle install --path vendor/bundle
d rake db:create
d rake db:schema:load
art a server
d rails s
First, install Docker and Docker Compose. The easiest way to do this on macOS is by installing Docker for Mac.
You can install rid
via Homebrew:
ew install creasty/tools/rid
Download a binary from here: https://github.com/creasty/rid/releases
Not supported yet
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.
Typical rid
directory looks like this:
# rid directory at the root of a project (e.g., same level as `.git`'s)
bexec/ # custom sub-commands for rid
nfig.yml # configuration file for rid
cker-compose.yml # docker-compose manifest
ckerfile # dockerfile
Note that rid/config.yml
and rid/docker-compose.yml
are regardlessly required for rid
to work with.
Configurable parameters of rid/config.yml
are the following.
Config struct {
// ProjectName is used for `docker-compose` in order to distinguish projects in other locations
ProjectName string `json:"project_name" valid:"required"`
// MainService is a service name in `docker-compose.yml`, in which container commands given to rid are executed
// Default is "app"
MainService string `json:"main_service"`
Executables in rid/libexec/
can be run as a sub command.
libexec/
o # `rid foo` -- this is executed in a container
d-bar # `rid bar` -- name starts with `rid-` is executed on a host computer
d-bar.txt # optionally, placing `.txt` file that shares the common basename enables "help" functionality
Help file should have a title in the first line:
greeting message
e:
rid bar NAME
The title (first line) appears on the help of rid
.
d
ute commands via docker-compose
e:
rid COMMAND [args...]
rid COMMAND -h|--help
rid [options]
ons:
-h, --help Show this
-v, --version Show rid version
--debug Debug context and configuration
ands:
compose # Execute docker-compose
foo
bar # Show greeting message
And rid COMMAND -h
prints the full contents.
d bar -h
greeting message
e:
rid bar NAME
Surprise surprise, rid
itself is developed by rid
!
d glide install # install dependencies
d make test # run lint and tests
d make # compile for darwin/amd64
bin/rid -v # execute a new binary