Last active
March 25, 2016 22:00
-
-
Save lirantal/2c6acbd11cc30b8b6695 to your computer and use it in GitHub Desktop.
This file contains 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
# On a Docker Toolbox install in Windows - | |
# SSH to the docker vm | |
docker-machine ssh default | |
# On a Docker Toolbox install in Windows - | |
# Configure a PROXY for the docker instances | |
## 1. Edit /var/lib/boot2docker/profile | |
## 2. Add the following: | |
## export HTTP_PROXY=<proxy> | |
## export HTTPS_PROXY=<proxy> | |
## 3. Restart the docker host VM: docker-machine.exe restart default | |
## Building a Docker container | |
docker build -t lirantal/projects . | |
## Running a previously built Docker container | |
## Accepts the following inputs: | |
## -p PUBLIC_PORT:PRIVATE_PORT | |
## -d - run in detached mode | |
docker run lirantal/projects | |
## Run a bash shell from the projects_web container and mount current directory to /opt/projects | |
docker run -it -v $(pwd):/opt/projects projects_web /bin/bash | |
# Get the docker env setup for applying to the shell | |
docker-machine env default | |
# Get IP of the local 'default' vm on a Windows docker setup | |
docker-machine ip default | |
# Run a shell on a remote docker to inspect the OS | |
docker exec -it <id> /bin/bash | |
# Re-run docker-compose for changes in .yml file to take place | |
docker-compose up -d | |
# Container logs | |
docker logs -f <id> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment