You are on page 1of 4

Cheat Sheet: Docker CLI

Command

curl localhost
docker build
docker build . -t
docker CLI
docker container rm
docker images
docker ps
docker ps -a
docker pull
docker push
docker run
docker run -p
docker stop
docker stop $(docker ps -q)

docker tag

docker –version
exit
export MY_NAMESPACE
git clone

ibmcloud cr images
ibmcloud cr login

ibmcloud cr namespaces
ibmcloud cr region-set

ibmcloud target
ibmcloud version
ls
Description

Pings the application.


Builds an image from a Dockerfile.
Builds the image and tags the image id.
Start the Docker command line interface.
Removes a container.
Lists the images.
Lists the containers.
Lists the containers that ran and exited successfully.
Pulls the latest image or repository from a registry.
Pushes an image or a repository to a registry.
Runs a command in a new container.
Runs the container by publishing the ports.
Stops one or more running containers.

Stops all running containers.

Creates a tag for a target image that refers to a source image.

Displays the version of the Docker CLI.


Closes the terminal session.
Exports a namespace as an environment variable.

Clones the git repository that contains the artifacts needed.

Lists images in the IBM Cloud Container Registry.

Logs your local Docker daemon into IBM Cloud Container Registry.

Views the namespaces you have access to.


Ensures that you are targeting the region appropriate to your cloud
account.
Provides information about the account you’re targeting.
Displays the version of the IBM Cloud CLI.
Lists the contents of this directory to see the artifacts.
Cheat Sheet: Understanding Kubernetes Architecture

Command
for …do
kubectl apply
kubectl config get-clusters
kubectl config get-contexts
kubectl create
kubectl delete
kubectl describe
kubectl expose

kubectl get
kubectl get pods
kubectl get pods -o wide
kubectl get deployments
kubectl get services
kubectl proxy

kubectl run
kubectl version

Cheat Sheet: Managing Applications with Kubernetes

Command
kubectl autoscale deployment
kubectl create configmap
kubectl get deployments -o wide
kubectl get hpa
kubectl scale deployment
kubectl set image deployment
kubectl rollout
kubectl rollout restart
kubectl rollout undo
Description
Runs a for command multiple times as specified.
Applies a configuration to a resource.
Displays clusters defined in the kubeconfig.
Displays the current context.
Creates a resource.
Deletes resources.
Shows details of a resource or group of resources.

Exposes a resource to the internet as a Kubernetes service.

Displays resources.
Lists all the Pods.
Lists all the Pods with details.
Lists the deployments created.
Lists the services created.
Creates a proxy server between a localhost and the
Kubernetes API server.
Creates and runs a particular image in a pod.
Prints the client and server version information.

Description
Autoscales a Kubernetes Deployment.
Creates a ConfigMap resource.
Lists deployments with details.
Lists Horizontal Pod Autoscalers (hpa)
Scales a deployment.
Updates the current deployment.
Manages the rollout of a resource.
Restarts the resource so that the containers restart.
Rollbacks the resource.

You might also like