Skip to content

Instantly share code, notes, and snippets.

@dejanu
Last active June 29, 2025 19:35
Show Gist options
  • Save dejanu/a7d4ad6340c5eae5130a964b592f3b75 to your computer and use it in GitHub Desktop.
Save dejanu/a7d4ad6340c5eae5130a964b592f3b75 to your computer and use it in GitHub Desktop.
RoadMap

Intro

Docker

  • What is a container here, just a fancy way to run a process
  • After Docker installation, we have the hello world for containers. Using docker CLI we can do:
# list all containers from your machine (by all we mean running and also stopped). 
# The output should be empty (since there are no containers which have been ran)
docker ps -a

# list all images from your machine. 
# The output should be empty (since there are no images pulled on your machine)
docker images

# run your first container. 
# The container engine tried to find an image named hello-world, and it did not find it, 
# therefore it goes to its default Docker registry, which is Docker Hub, to look for an image named “hello-world
# It finds the image there, pulls it down, and then runs it in a container
docker run hello-world

# rerun commands. What are the changes ?
docker ps -a
docker images
  • Docker flags (Display system-wide information and Go templates to manipulate the output format)

    • Search official images for desired : docker search --format "table {{.Name}}\t{{.StarCount}}\t{{.IsOfficial}}" <IMAGE>
    • Output image name and tag: docker images --format '{{.Repository}} and {{.Tag}}'
    • Output image name, tag and elapsed time + timestamp since the image has been created: docker images --format "{{.Repository}}:{{.Tag}} {{.CreatedSince}} --> {{.CreatedAt}}"
    • Inspect Cmd for desired : docker inspect -f '{{.Config.Cmd}}' <IMAGE>
    • Inspect Entrypoint for desired : docker inspect -f '{{.Config.Entrypoint}} <IMAGE>'
    • Inspect attached containers to bridge network: docker inspect network bridge --format "{{json .Containers }}"
    • Check root directory for Docker storage, defaults to /var/lib/docker: docker info -f 'Storage drive: {{.Driver}} and storage path {{.DockerRootDir}}'
    • Show docker disk usage docker system df
    • Inspect container runtimes: docker system info --format "{{.Runtimes}} {{.DefaultRuntime}}" or docker system info --format "Runtimes: {{.Runtimes}} with default {{ .DefaultRuntime }}"
    • Check container resource usage docker stats [OPTIONS] [CONTAINER], docker stats --no-stream
    • Check events docker events --filter event=restart --since=60m or docker events --filter event=restart --since=60m > events.log 2>&1
  • Flow: Using a Dockerfile we build a Docker image, and using a Docker image we start/run a container.

flowchart LR;
		Dockerfile-->Image;
		Image-->Container;
Loading
  • Debug Docker with systemctl/service and journalctl
systemctl status docker
systemctl daemon-reload
systemctl start docker
service docker restart
journalctl -xeu docker.service
journalctl -u docker

Kubernetes


⚠️ Avoid being stuck in tutorial hell and always use the official documentation

💻 Hands-on here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment