retrography
8/20/2015 - 6:10 PM

Docker Configuration and Use on OS X

Docker Configuration and Use on OS X

# see http://docs.docker.com/installation/mac/
# see https://docs.docker.com/reference/commandline/cli/

brew cask install dockertoolbox
docker-machine create --driver virtualbox default

# To start the machine
docker-machine start default

# To stop the machine
docker-machine stop default

# To list vm environment variables for the machine and export them as global environment variables
docker-machine env default
eval "$(docker-machine env default)"

# Create a data volume
docker create -v /data --name mongodata mongo

# To run a MongoDB instance based on the default MongoDB Docker image
docker run --name mongodb -d -p 27017:27017 --volumes-from mongodata mongo --storageEngine=wiredTiger

# To see running containers
docker ps 

# To open a bash interactive session
docker exec -it "get the container id from ps" bash