Last active
May 16, 2017 11:11
-
-
Save MrSaints/7660d8e7215ecab28c76 to your computer and use it in GitHub Desktop.
Notes on initiating a Docker Machine; killing Docker processes; cleaning Docker containers, and images; and building / running / executing with Docker. Docker, Docker, Docker...
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
# You probably don't need this one with the new Docker for MacOS # | |
docker-start() { | |
docker-machine start ${1:-dev} | |
eval "$(docker-machine env ${1:-dev})" | |
export DOCKER_IP=$(docker-machine ip ${1:-dev}) | |
echo The machine ip is DOCKER_IP=$DOCKER_IP | |
} | |
# These clean up commands are no longer necessary with `docker system prune` | |
docker-kill() { | |
docker-compose kill | |
docker stop $(docker ps -a -q) | |
} | |
docker-clean() { | |
docker-compose rm -f | |
docker rm -v $(docker ps -a -q -f status=exited) | |
docker rmi $(docker images -f "dangling=true" -q) | |
} | |
docker build --rm -f <Dockerfile> -t <Tag> . | |
docker exec -it <container> <command> | |
docker run --rm <image> <command> | |
docker-compose run --service-ports <service> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment