Cloud Tech by Victor

Search

30 results for “containers

Search results

Docker Networking

Why does publishing a port with -p 8080:80 not automatically make the container reachable from other containers?

-p (or --publish) maps a port on the Docker host to a port inside the container, specifically for reaching the container from outside the Docker network, from the host machine or the internet. Other containers on the same user-defined network do not need that mapping at all; they can reach the container directly on its internal port via the container's name and internal port, because they share the internal bridge network. Publishing a port is about host-to-container access, not container-to-container access.

Security

Container Image Scanning

How image scanning finds known vulnerabilities before a container ever runs, and why a minimal base image and a non-root user matter more for security than any scanner added afterward.

DevOps

Docker Fundamentals

How images, containers, volumes, and networks fit together in Docker's runtime model, and the mental shift from "installing software" to "running a packaged image" that trips up newcomers.

DevOps

Docker Networking

How Docker's bridge, host, and overlay network drivers work, how container DNS resolution happens, and the port-publishing model that trips up most beginners.

DevOps

Kubernetes Fundamentals

How Pods, Deployments, and Services fit together, what the control loop actually does, and why Kubernetes networking confuses people coming straight from Docker Compose.

Container Image Scanning

What does a container image scanner actually check, and how does it know an image is vulnerable?

A scanner builds a software bill of materials (SBOM) for the image, an inventory of every OS package and application dependency baked into its layers, then matches that inventory against a continuously updated vulnerability database. A match means a known CVE affects a specific version of a package present in the image; the scanner doesn't analyze the application's own logic, it identifies known-vulnerable versions of things the image happens to include, which is why keeping the dependency and base-image inventory small and current matters as much as running the scanner at all.

Container Image Scanning

Why does a smaller, minimal base image reduce security risk beyond just producing a smaller download?

Every package present in a base image is a package that can have a known vulnerability, and a full general-purpose distribution image bundles far more OS packages, libraries, and tools than most applications actually need at runtime. A minimal image (Alpine, a distroless image, or a multi-stage build's final stage) simply has fewer things in it that could ever show up in a vulnerability scan, which is a structural reduction in attack surface, not a mitigation that has to be maintained the way a scanner's exception list does.

Container Image Scanning

Why does Docker's official build guidance recommend running as a non-root user inside a container, and why not just use sudo when root is needed?

Running as root inside a container means that a successful application-level compromise (a code-execution vulnerability, an unsafely deserialized payload) hands the attacker root inside that container immediately, with no privilege-escalation step required, and depending on the container runtime's configuration, root inside a container can sometimes be leveraged toward the host. Creating a dedicated non-root user via `USER` in the Dockerfile means a compromise still has to escalate privileges to do serious damage. `sudo` is specifically discouraged in Docker's own guidance because of its unpredictable TTY and signal-forwarding behavior inside a container, not because privilege separation itself is unnecessary.

Docker Fundamentals

What is the difference between a Docker image and a Docker container?

An image is a read-only, layered filesystem snapshot plus metadata (entrypoint, exposed ports, environment); it never changes once built and can be shared through a registry. A container is a running (or stopped) instance of an image: Docker adds a thin writable layer on top of the image's read-only layers and starts a process inside an isolated namespace. You can start many independent containers from the same image, each with its own writable layer and state, the same way many processes can run from the same binary on a normal OS.

Docker Fundamentals

Why does data written inside a container disappear when the container is removed?

Anything a container writes lands in its own writable layer, which is deleted along with the container by `docker rm`. That is deliberate; it is what makes containers disposable and reproducible, a fresh container from the same image always starts from the same known state. Anything that actually needs to survive a container's lifecycle (a database's data files, uploaded assets) has to live outside that writable layer, in a named volume or a bind mount, which Docker mounts into the container at a chosen path but manages independently of the container itself.

Docker Fundamentals

Why is publishing a port with `-p 8080:80` different from the container just "having" port 80?

A container's ports exist only on its own private network namespace by default; nothing on the host or outside can reach them until Docker explicitly forwards a host port to it. `-p 8080:80` tells Docker's network layer to forward the host's port 8080 to port 80 inside the container's namespace, host port first, container port second. Leaving a port `EXPOSE`d in a Dockerfile only records metadata/documentation, it has no effect on connectivity at all: another container on the same Docker network can already reach any port the first container is listening on, EXPOSE or not. Publishing to the host is the one thing that always requires an explicit `-p`.

Docker Networking

What is the default Docker network driver and how does container-to-container communication work on it?

The default is the bridge driver, Docker creates a private virtual network on the host, and each container gets its own network namespace with a virtual ethernet interface connected to that bridge. Containers on the same user-defined bridge network can reach each other by container name, because Docker runs an embedded DNS server that resolves container names to their internal IPs on that network. Containers on the default (unnamed) bridge network do not get this automatic DNS resolution, only user-defined bridge networks provide it.

Docker Networking

What is the difference between the bridge and host network drivers?

With the bridge driver (the default), a container gets its own isolated network namespace and IP address, and ports must be explicitly published to be reachable from the host. With the host driver, the container shares the host's network namespace directly, no isolation, no port publishing needed, the container's ports are the host's ports. Host networking is faster (no NAT/bridge overhead) but sacrifices network isolation, so it is used selectively, not as a default.

Kubernetes Fundamentals

What is the difference between a Pod, a Deployment, and a Service?

A Pod is the smallest deployable unit, one or more containers that share network and storage, scheduled together onto a node. Pods are ephemeral and disposable; Kubernetes recreates them freely and their IPs change every time. A Deployment manages a set of identical Pods (a ReplicaSet under the hood), handling rolling updates, rollbacks, and keeping the desired replica count running even as individual Pods die. A Service gives that changing set of Pods a stable network identity, a fixed virtual IP and DNS name, so other things in the cluster don't need to track individual Pod IPs, which change constantly.

Kubernetes Fundamentals

What does the Kubernetes control loop actually do?

Every Kubernetes controller (Deployment, ReplicaSet, etc.) runs a reconciliation loop: it continuously compares the desired state (what you declared in a manifest, stored in etcd) against the observed actual state of the cluster, and takes action to close any gap. If you declared 3 replicas and only 2 Pods are running, the ReplicaSet controller creates one more. This is the same declarative, converge-toward-desired-state model as Terraform, but running continuously and automatically rather than on-demand.

Kubernetes Fundamentals

Why can't you rely on a Pod's IP address for service discovery?

Pods are ephemeral by design, Kubernetes kills and recreates them constantly (failed health checks, node drains, rolling deployments, autoscaling), and every new Pod gets a brand-new IP address. Hardcoding or caching a Pod IP breaks the moment that Pod is replaced. A Service solves this by providing a stable virtual IP and DNS name that always routes to whichever Pods currently match its label selector, regardless of how many times the underlying Pods have been replaced.

DevOps

Docker vs Podman

How Docker and Podman differ in architecture, rootless security, Compose support, and systemd integration, and when each is the right default.

Secrets Management

Why are environment variables considered a weaker place to store a secret than a dedicated secrets manager, even though they avoid hardcoding it in source?

Environment variables are readable by the entire process (and often child processes) they're set for, commonly get dumped into crash reports, debugging output, or `/proc` on Linux, and are easy to accidentally log in full, none of which requires a targeted attack, just an ordinary operational mistake. A dedicated secrets manager instead requires an authenticated, audited API call to retrieve a secret, can issue it as short-lived, and centralizes rotation and access logging in one place. Environment variables are a real improvement over hardcoding in source, but they are a stopgap, not the same security posture as centralized, audited secret retrieval.

Sorting Algorithms & Stability

An O(n^2) sort can be faster than an O(n log n) sort for small inputs. Why, and why doesn't that matter for a general-purpose sort function?

Big O describes asymptotic growth, not actual runtime, and O(n^2) algorithms often have smaller constant factors and simpler inner loops (no recursion or merge-buffer overhead) that make them genuinely faster in wall-clock time for small n, even though the more sophisticated O(n log n) algorithm would eventually win as n grows. This is exactly why production sort implementations, including Timsort, special-case small subarrays with a simple insertion sort internally rather than using the full merge-sort machinery on tiny inputs, getting the best of both regimes instead of picking one algorithm for every input size.

Blog

Step-by-Step Guide: Creating a Client Computer and Joining It to a Domain (Hyper-V Lab Setup)

As part of building a realistic domain based environment, this lab demonstrates how to create a client computer and join it to an existing Active Directory Domain Services (AD DS) domain hosted on Windows Server 2019 , using Hyper V. A domain environment is incomplete without client machines. Joini…

Rate Limiting Algorithms

A client sends a sudden spike of requests that exceeds the configured rate, but the API doesn't immediately reject any of them. Why not, and when does rejection actually start?

The token bucket has accumulated capacity up to the burst limit, if the client had been under the rate limit recently, unused tokens built up in the bucket, and that reserve absorbs a short spike without any request failing, exactly the point of separating burst capacity from steady-state rate. Rejection (a 429 response) only starts once the bucket is actually empty, every accumulated token has been consumed and the spike is sustained long enough that the rate of token consumption keeps exceeding the rate of token replenishment. This is why a token bucket, unlike a hard per-second cap, tolerates brief bursts gracefully while still enforcing a real steady-state ceiling.

Blog

How to Configure Secure File System Management with NTFS Permissions and Mapped Drives in a Windows Server Domain (Lab Guide)

This lab demonstrates how to design and implement secure file system management in a domain environment using Active Directory, Windows Server 2019, and Hyper V. The focus is on enterprise style file sharing, using NTFS permissions, group based access control, and mapped network drives, all aligned…

Message Queues & Event-Driven Architecture

A consumer receives a message, starts processing, but crashes before deleting it. What happens to that message, and why is this actually the desired behavior?

Once the visibility timeout expires without the message being deleted, it automatically becomes visible again in the queue and can be picked up by the same or a different consumer for another processing attempt. This is deliberate, not a bug: the alternative (a crashed consumer's message vanishing permanently) would silently lose data, whereas reappearing after timeout guarantees eventual processing at the cost of a possible duplicate attempt, which is exactly the trade-off "at-least-once delivery" describes. Setting the visibility timeout too short causes premature, unnecessary reprocessing of messages still legitimately being worked on; too long delays legitimate retries after a real crash.

React Rendering & Reconciliation

A component's state is preserved when a prop changes, but reset when a completely different element renders in the same spot. What determines which happens?

React associates state with a component's position in the render tree, not with the component instance or its props specifically. If the same component type renders at the same tree position across a re-render, its state is preserved regardless of what props changed. If a different component type (or a different element entirely) renders at that same position, React treats it as a genuinely different thing, destroys the old state, and starts fresh. This is why toggling a prop on the same `<Counter />` keeps its count, but swapping `<Counter />` for a `<p>` at that same spot in the tree resets it entirely, even though from the JSX it might look like a small, local change.

Sorting Algorithms & Stability

Why does Python's sort achieve O(n) in the best case rather than always costing O(n log n) like a textbook mergesort?

Python uses Timsort, which specifically looks for and exploits "runs," contiguous stretches of already-ordered (or reverse-ordered) elements already present in the input, merging those runs rather than treating the data as uniformly random. Fully-sorted input is the extreme case of this: it's already one giant run, so Timsort recognizes it and finishes in linear time instead of doing the full comparison work a naive O(n log n) sort would perform regardless of input order. This is exactly why Timsort performs so well on real-world data, which is very often partially sorted already, not uniformly random.

AWS Compute

What is the difference between ECS and EKS?

Both are managed container orchestrators, but ECS is AWS's own native orchestration model (task definitions, services, clusters) with no separate control-plane fee, while EKS runs an actual, standard, upstream Kubernetes control plane that AWS manages for you, and Amazon EKS charges a per-cluster fee specifically for that managed control plane, on top of whatever compute the worker nodes cost. Both can run workloads on EC2 instances you manage, or offload node/workload compute to AWS via Fargate or, on EKS specifically, EKS Auto Mode, so "serverless containers" is available either way; the real choice is whether you want Kubernetes's API and ecosystem (EKS) or a simpler, AWS-native model with less portability (ECS).

Database Locking & Deadlocks

Two transactions each update two of the same two accounts, but in opposite order, and deadlock. What's the actual fix, not just for this pair of transactions, but for the application generally?

The deadlock happens because Transaction 1 locks account A then waits for account B, while Transaction 2 locks account B then waits for account A, a circular wait. The general fix isn't retry logic alone, retries only paper over deadlocks that keep recurring, it's acquiring locks on multiple objects in the same, consistent order everywhere in the application (for example, always locking accounts in ascending id order), which makes the circular-wait pattern structurally impossible rather than merely less frequent. Retry logic is still worth having as a safety net, but consistent lock ordering is what actually eliminates this class of deadlock.

Kubernetes Security

What is the difference between the Baseline and Restricted Pod Security Standards levels, and why are they cumulative?

Baseline blocks the most well-known container privilege-escalation paths, privileged containers, host namespaces, hostPath volumes, dangerous Linux capabilities, while still allowing a fairly permissive pod spec otherwise. Restricted inherits every Baseline rule and adds real hardening on top: it requires running as non-root, forbids privilege escalation outright, requires a restricted seccomp profile, and requires dropping all Linux capabilities except NET_BIND_SERVICE. A read-only root filesystem is not part of either standard, it's a separate hardening measure some organizations layer on as their own policy, on top of, not as part of, Restricted. They're cumulative by design, Restricted is Baseline plus more, so a workload that passes Restricted automatically satisfies Baseline too, and a cluster can apply different levels per namespace based on how much a given workload can be trusted.

Linux Networking

How does nftables organize firewall rules, and what actually changed compared to iptables?

nftables organizes rules into tables (containers with no inherent semantics of their own) which hold chains, and chains hold the actual rules; a chain becomes active by being attached to a kernel hook such as input, output, forward, prerouting, or postrouting, which is the point in packet processing where its rules actually get evaluated. The structural change from iptables is consolidation: instead of separate tools for IPv4, IPv6, ARP, and bridge filtering (iptables, ip6tables, arptables, ebtables), nftables provides one framework and one command, `nft`, spanning multiple address families (`ip`, `ip6`, `inet`, `arp`, `bridge`), so a ruleset no longer has to be duplicated per protocol family the way it historically did.

Linux Storage & LVM

Why would you add a second disk to an existing volume group instead of just creating a new, separate filesystem on it?

Adding a disk as a new physical volume to an existing volume group extends that VG's total capacity, which lets an existing logical volume (and the filesystem on it) be grown into the new space without unmounting it, moving data, or changing the mount point the rest of the system already depends on. Creating a second, separate filesystem on the new disk instead means the original filesystem is still capacity-constrained by its original disk, and anything needing more room has to be manually split or migrated across two independent mount points rather than one that simply grew.

Search results for “containers” | Cloud Tech by Victor