Home Docker Cheatsheet
Post
Cancel

Docker Cheatsheet

“With Docker, developers can build any app in any language using any toolchain. “Dockerized” apps are completely portable and can run anywhere - colleagues” OS X and Windows laptops, QA servers running Ubuntu in the cloud, and production data center VMs running Red Hat.

Basic Commands

Verified cli can talk to engine

1
docker version

Most config values of engine

1
2
3
docker info
docker ps #see al docker running
docker top <name> #see info about the container

Docker command line structure

1
2
docker <command> (options) #old (still works)
docker <command> <sub-command> (options) #new

Deploy a nginx server

1
docker container run --publish 80:80 nginx

List all container running

1
docker container ls <options>
SyntaxDescription
–all, -aShow all containers (default show running)
–filter, -fFilter output based on conditions
–formatPretty-print containers using Go templates
–last, -nShow n last creates containers
–latest, -lShow the latest created container
–no-truncDont truncate output
–quiet, -qOnly display container ids
–size, -sDisplay total file sizes

Stop the container process but not remove it

1
docker container stop <id>

Assign a name to a container

1
docker container run --publish 80:80 --name webhost nginx

Show logs for a specific container

1
docker container logs 

Remove many containers together

1
docker container rm <id> <id> <id> -f #use f for stop the container before
This post is licensed under CC BY 4.0 by the author.

SQL Injection - Labs

Cross-site scripting (XSS)