Docker Interaction Process
CLI utility for straightforward provisioning and interacting with an application configured by docker-compose.
DIP also contains commands for running support containers such as ssh-agent and DNS server.
https://github.com/bibendi/dip/releases
brew tap bibendi/dip
brew install dip
TODO
dip completion bash > /usr/local/etc/bash_completion.d/dip
source /usr/local/etc/bash_completion
TODO
dip --help
dip SUBCOMMAND --help
version: '1'
environment:
COMPOSE_EXT: development
RAILS_ENV: development
BUNDLE_PATH: /bundle
compose:
files:
- docker/docker-compose.yml
- docker/docker-compose.$COMPOSE_EXT.yml
project_name: bear$RAILS_ENV
interaction:
sh:
service: app
bundle:
service: app
command: bundle
rake:
service: app
command: bundle exec rake
rspec:
service: app
environment:
RAILS_ENV: test
command: bundle exec rspec
rails:
service: app
subcommands:
s:
service: web
c:
command: bundle exec rails c
psql:
service: app
command: psql -h pg -U postgres bear
provision:
- docker volume create --name bundle_data
- dip sh ./script/config_env
- dip compose up -d pg redis
- dip bundle install
- dip rake db:migrate --trace > /dev/null
Run commands defined in interaction
section of dip.yml
dip run rails c
dip run rake db:migrate
run
argument can be ommited
dip rake db:migrate
Run commands each by each from provision
section of dip.yml
Run docker-compose commands that are configured according with application dip.yml
dip compose COMMAND [OPTIONS]
dip compose up -d redis
Runs ssh-agent container base on https://github.com/whilp/ssh-agent with your ~/.ssh/id_rsa.
It creates a named volume ssh_data
with ssh socket.
An applications docker-compose.yml should define environment variable SSH_AUTH_SOCK=/ssh/auth/sock
and connect to external volume ssh_data
.
dip ssh add
docker-compose.yml
services:
web:
environment:
- SSH_AUTH_SOCK=/ssh/auth/sock
volumes:
- ssh-data:/ssh:ro
volumes:
ssh-data:
external:
name: ssh_data
Runs DNS server container based on https://github.com/aacebedo/dnsdock
dip dns up