docker-hat v0.2.0
docker-hat
A hat for your Docker!
This is a set of helper commands to run and manage Docker containers on OS X.
Requirements
- Homebrew
- VirtualBox
- Node.js (>= 0.12)
- Automatically installed if installing via Homebrew!
Installation
Super simple with Homebrew, just run the below and you'll be up-and-running in no time:
brew tap chinthakagodawita/homebrew-dh
brew update
brew install docker-hatCommands
All commands are simply sub-commands of the dh binary. A full list is below (examples coming soon!):
dh init
Sets up Docker to run on your Mac. This goes off and sets up (via dinghy) the following things:
- Docker host VM (boot2docker): To run your containers in,
docker-machineis used to instrument this - NFS server (unfsd): So that files can be shared to the container without being bottlenecked by VirtualBox's shared folder implementation
- DNS nameserver (dnsdock): Creates a wildcard DNS on
*.dockerwhich automatically maps to the Docker host
Usage
dh initdh soe
Starts up a nifty Standard Operating Environment for building various applications in. Currently only supports PHP (with special focus on Drupal & Wordpress) but more coming soon!
See the docker-containers repository for a full list and Dockerfiles.
Subcommands
dh soe start
Start up a new container using one of the special pre-built SOE images.
Usage
dh soe start <container-name>dh soe stop
Stop an already-running container.
Usage
dh soe stop <container-name>dh soe restart
Restart a running container using the same settings it was started up with.
Usage
dh soe restart <container-name>dh soe drush
Run Drush inside on of your running containers. Sets up paths correctly so that it executes on your docroot.
Usage
dh soe drush <container-name> [command]dh host
Controls your Docker host virtual machine and environment.
You shouldn't normally need to start or stop this manually—it should be brought up when required. This command is there for all the times it refuses to listen.
Subcommands
dh host start
Start the Docker host virtual machine.
Usage
dh host startdh host stop
Stop the host.
Usage
dh host stopdh host restart
Restart the host.
Usage
dh host restartdh host status
Show Docker host status.
Usage
dh host statusdh exec
Run a command (any command!) in a container.
Usage
dh exec <container-name> <command>Example
dh exec foo tail -f /var/log/apache2/error.logdh shell
Attaches a bash shell to one of your containers and gives your full interactive control. Simply type exit to close.
Usage
dh shell <container-name>Example
dh shell foo