Skip to content

Instantly share code, notes, and snippets.

@crispgm
Created September 7, 2016 03:54
Show Gist options
  • Save crispgm/7890550820ff4c62d3c020bad67de3b7 to your computer and use it in GitHub Desktop.
Save crispgm/7890550820ff4c62d3c020bad67de3b7 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment