Skip to content

Instantly share code, notes, and snippets.

@gscattolin
Last active April 25, 2016 08:18
Show Gist options
  • Save gscattolin/3f4e146a7ede8bb56944a833b4982ef4 to your computer and use it in GitHub Desktop.
Save gscattolin/3f4e146a7ede8bb56944a833b4982ef4 to your computer and use it in GitHub Desktop.
Dockers commands
# first make sure that the virtual machine is running
docker-machine start dev
Set environment variables to dictate that docker should run a command against a particular machine:
$ eval "$(docker-machine env dev)"
Check if environment is set:
$ env | grep DOCKER
DOCKER_HOST=tcp://192.168.99.100:2376
DOCKER_CERT_PATH=/Users/dm/.docker/machines/.client
DOCKER_TLS_VERIFY=1
DOCKER_MACHINE_NAME=dev
#remove unused docker images
docker rmi $(docker images --filter "dangling=true" -q --no-trunc)
#run bash in docker image
docker exec -i -t 665b4a1e17b6 bash
#run images from yml file
docker-compose -f docker-compose.debug.yml up -d
#build images
docker build -f Dockerfile-sth -t dockerimagename:debug .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment