#Running Instructions There are two basic ways to run this demo in a Docker container. You can run the docker container directly on your mac using boot2docker and VirtualBox, or you can run it in a Vagrant VM that is configured as a Docker daemon. The Vagrant approach allows you to run on a Windows box and is the best way to mimic your ci/test/production environments during development.
##Vagrant & VirtualBox ###Requirements
- Install Vagrant
###Steps
- Clone this project
- Run
vagrant up
from the root of this project - This process will take a while because of the downloads involved. It will return before the app is running, so if you want to watch the status, you will need to follow the following steps:
vagrant ssh
docker ps
to see the process running in Vagrant. Copy the process id.docker attach {process id}
will tail the output of the process. To exit, useCtrl+p
orCtrl+q
to quietly quit.Ctrl+c
will kill the process.- When you see the "Waiting..." Grunt output, you are ready for step 6.
- Open
localhost:9000
in your web browser
###Tips
- You can't just use any base box. The VM needs to be customized to allow for the Docker daemon to provision. This includes things like:
- Creating a
docker
group and making sure that thedocker
andvagrant
users are in it - (need to fill this in)
- When you use
vagrant destroy
you will have to go through the whole Docker image download again because the cache lived in the Vagrant VM. - When you're done working, use
vagrant suspend
to save the state of your environment andvagrant resume
to bring the environment back.
###Todo
- Parallels provider
- Restart policy for
vagrant halt
or reboot scenarios
##boot2docker & VirtualBox ###Requirements
- Install boot2docker
###Steps
- Clone this project
- Get boot2docker running
boot2docker init
(first time only)boot2docker start
(first time & afterboot2docker stop
or reboot)boot2docker ip
(record this IP address, it will be where the app will be running)- Start the container with all of the appropriate mappings
docker run --privileged=true -it -p 9000:9000 -p 35729:35729 -v $(pwd):/var/www creativeux/centos-grunt
NOTE: This will take a while the first time becausenpm install
will be downloading the Internet. You should see the process in stdout, though.- Open
{boot2docker ip}:9000
in your web browser
###Tips
- Create an alias in your .bash_profile called
shellinit
(or something) that runs the$(boot2docker shellinit)
command. You'll be using that a lot.