
- Containers package an application and everything it needs (binaries, libraries, configuration, logs, and data) together. This eliminates fragmented configurations across /etc, /var/lib, /var/log, etc., and makes migration or replication to other hosts predictable and repeatable.
- Example: A MariaDB server inside a container keeps the daemon, configuration files, databases, and logs together. Copy or pull that container on another host and it behaves the same way.
- On modern RHEL-based distributions (CentOS Stream, RHEL) Docker packages may not be available; Podman is the recommended replacement. Podman is daemonless, OCI-compliant, and provides Docker-compatible CLI behavior via the podman-docker wrapper.
Podman includes a Docker-CLI compatibility wrapper (podman-docker). You can use
docker ... commands, or call podman directly. Podman is daemonless and integrates with systemd and rootless workflows.- Container tools consult /etc/containers/registries.conf to determine search registries for unqualified image names. To prefer docker.io only, set the unqualified-search-registries array to [“docker.io”].
- Suppress the informational docker wrapper message by creating the marker file:
docker with podman if you prefer explicit Podman commands.
Search for nginx images in the registry:
- By default, running without -d attaches your terminal to the container’s stdout/stderr. Use Ctrl+C to stop.
- docker rmi fails if an image is in use by any container. Preferred safe removal sequence:
- Stop containers: docker stop <container>
- Remove containers: docker rm <container>
- Remove image: docker rmi <image>
- Assign a name and publish ports with —name and -p HOST:CONTAINER. Example: run nginx named mywebserver with host port 8080 mapped to container port 80:
- Use netcat (nc) to query the server. Pass host and port as separate arguments (no colon):
Ports below 1024 are privileged. To bind host port 80 to a container, run the command with elevated privileges (sudo) or map a non-privileged host port (>=1024).
- Get detailed help for any command with —help:
Links and references
- Podman documentation
- Containers configuration (containers.conf / registries.conf)
- Docker CLI reference