Some handy command to work with containers. We’ll assume a docker image ubuntu is available on current machine.
- Run interactive shell (or any other command) on ubuntu image and create a container (named ubuntu1).
To detach tty without existing shell, use
Ctrl-p
+Ctrl-q
. Otherwise useCtrl-d
.To attach it again use
- List containers
- Start/stop/restart/remove/kill containers
- Run a command inside a running container
- Get an interactive bash shell in a running container
- Run multiple commands inside a running container

Docker Run Flags
Docker Cheat Sheet. Pull the Docker repository; docker pull wpscanteam/wpscan. Run WPScan and enumerate usernames; docker run -it -rm wpscanteam/wpscan -url -enumerate u. When using -output flag along with the WPScan Docker image, a bind mount must be used. Otherwise, the file is written inside the Docker container, which is then thrown away. Base commands: Creating a new container. Docker run -d (runs in background -p:. Creates a new container from an image. If you run it 4 times, it will create 4 containers Options: -name Give the container a name, otherwise it will pick a default name.

Docker Command Line Cheat Sheet
Suggested posts:
