Last active
August 29, 2015 14:27
-
-
Save retrography/748f98ea0d282c811564 to your computer and use it in GitHub Desktop.
Docker Configuration and Use on OS X
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment