crispgm
9/7/2016 - 3:54 AM

Docker commands

Docker commands

Build Dockerfiles:

docker build -t crisp/nginx /path/to/Dockerfile

Run in daemon mode:

docker run --name nginx -d -p PORT1:PORT1 -p PORTn:PORTn -v VOL1:VOL1 -v VOLn:VOLn crisp/nginx

Run in interactive mode:

docker run --name nginx -t -i -p PORT1:PORT1 -p PORTn:PORTn -v VOL1:VOL1 -v VOLn:VOLn crisp/nginx

Kill all containers:

docker ps -a|grep nginx|awk '{print $1}'|xargs docker rm