This tools is a wrapper over docker-compose.yml
, which allows you to re-use common configuration between projects without copying
docker-compose
and Dockerfile
files.
It's meant to be used for libraries development.
-
Install Docker and
docker-compose
first -
brew install rde
-
rde init
—generates pre-built configuraion insideRDE_HOME
directory (defaults to~/.rde
) (optional: generated the first time you use RDE)
You can open bash session within a specific environment (executor) with current directory mounted under /app
without any configuration:
$ rde -e ruby
root@1123:/app#
Alternatively you can run a command within a specific envrironment:
$ rde run -e jruby -- ruby script.rb
You can preconfigure the default executor by adding the .rde.yml
into the project's root directory:
# main executor name (or full configuration)
executor: ruby
# additional environment variables (merged with the original)
environment:
- DATABASE_URL=postgres://postgres@postgres:5432/docker
# expose ports
ports:
- 3000:3000
# list of other executors (e.g., databases)
depends_on:
- executor: postgres
Now you can launch the env by simply running rde
from the project's root directory:
$ rde
root@1123:/app#
// equals to
$ rde -e ruby --env="DATABASE_URL=postgres://postgres@postgres:5432/docker" -d postgres
// run with --service-ports
$ rde --ports -- rackup -p 3000
You can add aliases to avoid typing the same options all the time:
rde alias jruby='run -e jruby -- ruby'
rde jruby script.rb
Aliases are stored in ~/.rde/aliases
, you can edit them manually:
jruby='run -e jruby -- ruby'
RDE generates virtual docker-compose.yml
file every time you run a command by glueing executors configuration
and your local configuration if any.
Volumes, networks, images—everything is reused between the projects.
That's it!
Resources:
docker-compose.yml
from STDIN: https://gist.github.com/rmetzler/715cd24ded7438ace962