Pular para o conteúdo
← Back to Skalablog

Published article

What Should a Docker Tutorial for Beginners Teach First?

Claude CodeGitHub CopilotNext.js

One command, docker run nginx, starts a web server on a machine that has never had nginx installed. That is the first surprise in a Docker tutorial for beginners, and it is the fastest way to see why containers replaced week-long laptop setups.

What does a Docker tutorial for beginners need to cover?

A useful Docker tutorial for beginners needs five things: what a container is, how images work, how ports and volumes connect containers to your machine, how Docker Compose declares a full environment, and how a Dockerfile packages your own application. Everything else in Docker builds on those ideas.

This article compresses the 86-minute live stream "Docker do zero em uma hora", published on 10 February 2025 by Full Cycle, a Brazilian technology school whose host Wesley Williams ran the session as a warm-up for its Full Stack & Full Cycle immersion event. The audience was expected to already know how to program; the goal was a one-hour leveling, not a complete course.

Docker itself is an open-source container technology, and Docker, Inc. is the company behind it and its developer tooling such as Docker Desktop. On Windows, Docker recommends installing with WSL 2 for better integration. Remember that Docker is a Linux technology at its core, so on macOS or Windows the daemon runs inside a lightweight Linux virtual machine managed by Docker Desktop.

For readers exploring Brazilian dev-education ecosystems alongside Full Cycle, channels and programs such as Gustavo Dev Doido with his Bootcamp do Dev Doido, or the Crazystack Typescript track at crazystack.com.br, occupy a similar space of free live events and paid deep-dive courses. They are alternatives for structured learning, not parts of Full Cycle.

Why is a container lighter than a virtual machine?

A container is lighter because it is an isolated process on the host kernel, not a full guest operating system. A virtual machine virtualizes hardware and boots an entire OS per application, so each VM consumes gigabytes of memory and needs patching and boot time of its own.

The host explains it this way: a container "thinks" it is an operating system, but it is a normal process managed by the container runtime. Because it is just a process, there is no boot wait, and a container image can measure megabytes instead of gigabytes. Start the process and the application is running; stop it and nothing lingers on your machine.

The same packaging is what fixes environment drift. Everything the application needs, from the runtime version to system libraries, is specified in the image, so the container behaves identically on your laptop, a teammate's laptop, and a production server.

How do images, containers, and ports work on your first run?

Images, containers, and ports connect through one rule: you always create a container from an image, and the container only exposes a port to your machine if you publish it. Images live in registries such as Docker Hub, which hosts ready-made images for almost any tool.

The classic first command is docker run hello-world. It pulls an image from Docker Hub, creates a container that prints a message, and exits. Running docker ps shows only running containers; docker ps -a shows the exited hello-world container too, proving a container lives exactly as long as its main process.

Running docker run nginx starts the nginx web server inside a container listening on port 80. A curl localhost from your machine still fails at this point, because that port belongs to the container's network namespace, not yours. You can verify the server works with docker exec -it <container> bash, then curl localhost from inside.

Publishing ports with -p

To reach nginx from the host, remove the container and rerun it with a port mapping such as -p 8080:80. This creates a bind from your machine's port 8080 to the container's port 80, so curl localhost:8080 returns nginx's welcome page. Any change made inside a container, like the edited HTML page in the live stream, is lost when the container is removed, because images are immutable snapshots and containers do not persist edits.

How does Docker Compose and a bind mount improve daily work?

Docker Compose turns a stack of manual commands into one declarative file and one command. In practice, the host said, developers spend their days in docker compose up -d to start, and docker compose down to stop, rather than memorizing dozens of low-level commands. The file is a docker-compose.yml listing services, images, and port mappings; docker compose ps then shows the running stack. The feature is documented in the Docker Compose docs.

A bind mount maps a folder on your machine over a folder inside the container, so files you edit locally appear inside the container immediately. Mounting a local ./html folder over nginx's HTML directory makes edits to index.html show up on refresh, with no rebuild and no image change.

The same pattern removes local installs entirely. Adding a MySQL service to Compose gives the project a database in seconds, with its data files kept in a volume so they survive container removal. The live stream's example project ran nginx and MySQL side by side, each as its own container, and the audience saw a RabbitMQ service added the same way. If you juggle five projects, each with its own database version, one up -d per project beats a shared, always-running database, though the host acknowledged a shared database container via Docker Desktop extensions is an option for weak machines.

What do docker init and a Dockerfile actually do?

docker init and the Dockerfile answer a different question from Compose: how do you package your own application? docker init asks your language, framework version, entry file, and port, then generates a Dockerfile and Compose configuration ready for production.

The live stream generated a Node.js setup this way, then asked GitHub Copilot, GitHub's AI pair programmer, to build a small Node application with a MySQL connection in agent mode. The resulting Dockerfile copied package., ran npm install with cache optimization, copied the source, and declared the start command. One debugging detail mattered: the Claude Code connected to the database using the hostname db, because in Compose, services reach each other by service name, not localhost.

A second docker init run on a Go web server showed the security options beginners usually skip: running as a non-root user with no shell, disabling passwords, and producing a minimal static binary image. The lesson for beginners is that generated production Dockerfiles look large because they harden the container, while a development Dockerfile can be a few lines, such as a FROM golang:alpine base, a COPY into /app, and a tail -f /dev/null to keep the process alive while you work interactively with go run main.go.

How do you build and share your own image?

You build and share an image with docker build -t <namespace>/<name>:<tag> ., then docker push, which uploads it to your Docker Hub namespace. Anyone with Docker can then docker run that image and reproduce your exact application.

The stream hit a real beginner trap here: the host's Apple M1 machine is ARM, and the first push only targeted that architecture, so x86 machines could not pull it correctly. The fix was docker buildx, the multi-platform build tool, which builds and pushes the same tag for amd64 and arm64 in one step. This also explained why Docker on any non-Linux host runs containers inside a Linux VM.

Because the application is fully described by its Dockerfile, deployment becomes a copy operation. The host deployed the Go "hello world" to Google Cloud Run, a managed container service, in a single click from a VS Code extension, and the same Dockerfile would work on AWS or Azure. The container platform that manages thousands of these at scale is Kubernetes, which handles restarts, scaling, and scheduling of many containers, though it was explicitly out of scope for the session. Related alternatives exist; the host pointed viewers to his Podman comparison video for a data-based opinion.

What are the limits of a one-hour Docker tutorial for beginners?

A one-hour Docker tutorial for beginners is a leveling exercise, and it deliberately leaves out the depth production work demands. The host said this directly: Full Cycle runs dedicated container courses at multiple levels, and the live session existed to prepare viewers for a coming immersion event built on Go, Next.js, Kafka, WebSockets, and microservices.

Three caveats deserve emphasis. First, container edits are ephemeral; anything you change inside a running container disappears with it, so real configuration belongs in images or mounted volumes. Second, the session's productivity claims, like rebuilding an environment in seconds or one-click cloud deploys, are the speaker's first-hand experience with specific small demos, not benchmarked or independently verified results. Third, a hardened generated Dockerfile reduces attack surface by dropping root and shell access, but it does not by itself make a deployment compliant or secure; your application and organization still own those controls.

The host's closing argument is worth keeping in scope: he compared Docker's workplace necessity to Git, and the live chat confirmed the range of audiences, from first-timers to Kubernetes cluster administrators. Treating that as a universal employment claim would overstate it, but as a statement about mainstream backend development it reflects how widely containers are used.

FAQ

  • Do I need Docker Desktop to follow this tutorial? Docker Desktop is the easiest path on Windows and macOS, and it bundles tools like docker init. On Linux you can install Docker Community Edition directly, or run the engine inside WSL 2 on Windows without Docker Desktop, losing some convenience features.
  • Why did my change inside a container disappear? Images are immutable snapshots and containers do not persist edits. To keep changes, bake them into a new image with a Dockerfile, or keep editable files in a bind mount on your host machine.
  • Why does my app connect to the database with the hostname "db"? Inside a Compose project, services reach each other by service name on the Compose network. Your application should use the service name from docker-compose.yml as its database host, never localhost.
  • Do I still install Node, Go, or MySQL on my machine? With containers, no. The live stream edited and ran a Go application inside a development container without Go installed locally, and databases run as Compose services with data stored in volumes.
  • When do I need Kubernetes? Only when you run many containers that need automated restart, scaling, and scheduling across machines. For a single project with a few services, docker compose up -d is the everyday workflow, and Kubernetes is a later step.

From a live stream to a written reference

The core insight of this session is that Docker turns environment setup from a week of installs into a file you commit alongside your code. That same idea applies to knowledge itself: a long live stream like this one holds an hour of practical teaching that most viewers will never revisit, because video is hard to skim, search, or quote.

If you record tutorials, interviews, or architecture walkthroughs on YouTube, you can turn that footage into a written article readers can scan and search. Paste your video URL at Skala Blog, get a transcription, and generate an article that preserves your commands, your caveats, and your sequence of ideas in publishable form.

Source video