Docker and Kubernetes CLI Reference

Search Docker, Compose and kubectl commands in plain words, such as follow logs, shell into a container or roll back a deployment, with the right flags and safety notes.

Funziona nel tuo browser. I tuoi file non lasciano mai il dispositivo. Scopri come verificarlo

…

Come si usa

  1. 1
    Search

    Type the task in plain words.

  2. 2
    Filter

    Pick a section, or show only careful commands.

  3. 3
    Read the notes

    Check what each flag does.

  4. 4
    Copy

    Replace names and placeholders.

  5. 5
    Run

    Use the command in your terminal.

  6. 6
    Save

    Download the CSV for your runbook.

Informazioni su questo strumento

Containers bring two command-line tools most developers half-remember: docker for images and containers on one machine, and kubectl for clusters. When something breaks at 2 a.m., you need the exact command quickly: how to follow a pod's logs from the crashed container, how to open a shell inside a running container, how to roll back a deployment, how to free disk space without deleting volumes you still need. This reference groups the commands by task: images, containers, Compose, volumes and networks, clean-up, kubectl basics, applying manifests, deployments, debugging and configuration. Each entry explains what the command and its flags do, and commands that delete data are flagged. Search in plain words, filter by section, or show only the commands that need care, and download the list as CSV.

Debugging a failing pod

1. kubectl get pods to see the status (CrashLoopBackOff, ImagePullBackOff, Pending). 2. kubectl describe pod for events: image pull errors, failed probes, scheduling problems. 3. kubectl logs --previous for the output of the container that crashed. 4. kubectl get events --sort-by=.lastTimestamp for the bigger picture. 5. kubectl debug to attach a container with tools when the image has none.

Freeing disk space safely

docker system df shows what uses space. docker system prune removes stopped containers, unused networks and dangling images but keeps volumes. Adding -a and --volumes removes everything unused including volumes, which deletes data, so it is flagged.

Compose versus docker run

Compose files describe a whole application and are easier to keep in Git than long docker run commands. Our Dockerfile and Compose generator converts docker run commands into compose.yaml.

Rollouts

kubectl rollout status waits for a deployment, rollout undo returns to the previous version and rollout restart replaces all pods, which is useful after changing a ConfigMap.

Building and publishing images

Tag images with a version or commit hash rather than latest, so deployments are reproducible and rollbacks pick the right image. docker buildx build --platform builds for both Intel and ARM servers in one step, and docker image history shows which layer makes an image large.

Compose day to day

docker compose up -d --build rebuilds and restarts only what changed, docker compose logs -f follows one service and docker compose config prints the final merged file, which is the quickest way to spot an indentation mistake or an unexpanded variable.

Secrets

Kubernetes Secrets are only base64-encoded unless the cluster encrypts them at rest; treat access to them carefully.

Limits

The list covers everyday commands. Cluster administration, Helm, service meshes and cloud-provider CLIs are not included. Flags follow current Docker Engine and Kubernetes releases.

Esempio svolto

Searching "logs" returns docker logs -f --tail 100 web, docker compose logs -f service and kubectl logs -f pod -c container --previous, each with a note on what the flags do.

In breve

Domande frequenti

How do I get a shell in a container?

docker exec -it name sh, or kubectl exec -it pod -- sh in Kubernetes.

How do I see why a pod keeps restarting?

kubectl describe pod and kubectl logs --previous.

How do I roll back a deployment?

kubectl rollout undo deploy/name.

Will docker system prune delete my data?

Not without --volumes; with it, unused volumes and their data are deleted.

Can I export the list?

Yes, as CSV.

Does it cover Helm?

No. It covers docker, docker compose and kubectl.

Completamente gratisNessun costo, nessuna registrazione
I file restano privatiTutto funziona nel tuo browser
Facile nella tua linguaDisponibile in molte lingue