Cheatography
https://cheatography.com
Overview
docker
|
Run these docker sub-commands to have an overview of the Docker daemon. |
ps
|
List running containers |
ps -a
|
List all containers |
images
|
List all images |
version
|
Display version |
info
|
Various informations on the Daemon |
Building an image
docker build DIR
|
Build an image from the current directory, by default. Example: docker build -t my-image . |
-t
|
The tag of the built image |
|
|
Running a container
docker run
|
Run a container from a given image. docker run IMAGE-NAME |
-d
|
Run in background |
-i
|
Interactive session |
-t
|
TTY |
-p H:C
|
Exposes the port C of the container to the port H of the host |
-v H:C
|
Mount the host path H at the path C in the container |
--rm
|
Remove the container when exited |
--name
|
Give a name to the container |
Docker-Compose
docker-compose [command]
|
Manage the Docker application stack. |
up
|
Run the stack |
-d
|
Run in the background |
kill
|
Kill all the containers or a specific one if precised |
scale
|
Scale the given container with the given amount of replicas.
docker-compose scale CONTAINER=REPLICAS |
ps
|
List running containers of the stack |
rm
|
Remove the containers |
build
|
Force (re)build of the stack's containers |
|
|
Managing a container
docker
|
Run the following sub-commands followed by the container ID or name. Example: docker kill nginx |
logs
|
Get the logs of the container |
--follow
|
Follow the logs |
rm
|
Remove the container |
-f
|
Force removal of the container |
kill
|
Kill the container |
inspect
|
Inspect the details of a container |
dock-cli
dock-cli [command]
|
Manage the Docker application stack. |
start
|
Start the application stack |
ps
|
List running containers |
reset
|
Reset the given containers |
docker:doctor
|
Run a set of tests about the Docker setup |
docker:install
|
Install Docker and configure it to have direct IP routing and DNS resolution with DnsDock |
kubectl
--namespace=NAMESPACE
|
Set the command's context |
config use-context
|
Change the current configuration context. |
get OBJECT [name]
|
Get the given object(s). If name is given only get the object with the given name instead of a list.
OBJECT can be: pod , rc , service , ds , deployment , pvc , pv , ingresses , ... |
-o yaml
|
Outputs a YAML instead of printing the details |
describe OBJECT NAME
|
Describe the given object. Will display basics and events. |
exec POD COMMAND
|
Run a given command in a pod.
exec -it POD /bin/bash |
-it
|
Ask for an interactive shell |
create -f FILE
|
Create a resource from the file FILE |
delete OBJECT NAME
|
Delete the object of type OBJECT named NAME |
logs POD
|
Get the logs of the pod named POD |
edit OBJECT NAME
|
Edit the YAML definition of the object |
|
Created By
Metadata
Favourited By
and 6 more ...
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets