You are on page 1of 1

Docker Command [options] Description

docker image
This command provides the list of available images

This command is used to list containers.


docker ps[-a] • By default, it only shows the running containers.
• Use the parameter [-a] to display all containers residing on the
machine. 
This executes a command inside a running container.
• It can provide and interactive use (using the -i parameter) and get a
docker exec [-i [-t][-u terminal inside the container (using the -t parameter). Any number of
username]container_name [command] arguments can be chained using only one dash (e.g., -it)
• It is used commonly to enter a bash shell (command-line shell) and
run command interactively inside the container.
• -u username, execute the command as user username. If the
command is a shell, the login is done as a user username.
This command shows the internal logs of a running container.
docker logs [--tail n ] [-f] [-t] container • --tail n, show the last n lines of logs.
• -f, keep showing the logs until interrupted via CTRL-C
• -t, show the timestamps.

You might also like