show all containers:
docker ps -a
stop all containers:
docker kill $(docker ps -q)
remove all containers:
docker rm $(docker ps -a -q)
remove all docker images:
docker rmi $(docker images -q)
enter docker container:
docker exec -it $(container id) bash
build docker image:
docker build -t $(image name) .
show all build failure images:
docker images -f “dangling=true” -q
remove all build failure images:
docker rmi $(docker images -f “dangling=true” -q)
create docker-machine on virtualbox:
docker-machine create -d virtualbox $(machine name)
set docker environment:
eval “$(docker-machine env)”
unset docker environment:
eval “$(docker-machine env -u)”
show docker all network:
docker network ls
show docker network detail information:
docker network inspect $(docker network)
start container with forwarding port setting
docker run -p $(host_port1):$(container_port1) -p $(host_port2):$(container_port2) $(docker_image)
ex. # docker run -p 60022:22 -p 2181:2181 -p 8090:8090 -p 60000:60000 -p 60010:60010 -p 60020:60020 -p 60030:60030 qmi
start container with hostname setting
docker run –hostname $(hostname) $(docker_image)
ex. # docker run –hostname qmi_docker qmi
start container with input/output tty
docker run -it $(docker_image)
stop container
docker stop $(container id)
build image from container