Docker Quick Start: Why? What are containers for? Hardware?
What are Docker containers?
Docker containers are small isolated program units that can be started independently of the operating system on almost any PC or server. The user interface of a container is usually provided in the form of a web service and can thus be accessed via an address in the browser. Calling from a PC, smartphone or tablet is done via any browser and therefore does not require any additional installed software or app.
How can a Docker container be started?
To start a container, it is sufficient to specify an image in the form of manufacturer/imagename. This is made possible by the Docker Registry, a kind of library for containers. After installation, Docker is connected to the official online Docker Registry: Docker Hub, which means that specifying the imagename is enough to download and launch the container: no matter what hardware, no matter what operating system, and no matter what other programs have already been installed on the system: Due to the encapsulation, the containers are isolated and independent and contain all the dependencies necessary for operation.
Command for starting a container
In detail, the startup process of a container in the terminal looks like this:
docker run docker/getting-started
The "docker run" command downloads the "getting-started" container from the "docker" vendor and starts it:
C:\Users\LiBe>docker run -p 8080:80 docker/getting-started
Unable to find image 'docker/getting-started:latest' locally
latest: Pulling from docker/getting-started
...
2023/05/28 18:30:23 [notice] 1#1: start worker processes
The parameter -p 8080:80 publishes port 80 and makes it available through localhost and port 8080:
How to access the user interface of a container?
A Docker service is usually accessed via a provided web service. Typically, the web server provided by a container can be accessed via the browser with localhost and a port specified when starting the container: as an example: http://localhost:8080.
Prerequisite: almost any PC or server, operating system and the Docker installation.
Any computer or mini-PC with x68-64 architecture can be used as hardware for starting the containers, see: Home Server. Depending on which operating system is used, the actual Docker installation differs:
- Docker installation: Linux: Docker Engine 👍(Recommended variant).
- Docker installation: Windows: Docker Desktop (For testing and demo purposes).
Docker containers require a Linux kernel, so container scan likely be run with a Linux distribution - unlike Windows - with less overhead.
Multiple containers for a given service -> Docker Compose.
Docker containers provide network services, as an example a web server or database. Certain web applications require multiple containers to run. The launch of multiple containers and their access to and among each other can be specified using Docker Compose and a simple test file: docker-compose.yml.
The previously mentioned container: "getting-started" can be defined using a docker-compose.yml file as follows:
Text file named "docker-compose.yml".
Content:
services:
app:
image: docker/getting-started
ports:
- 8080:80
If a text file is populated with this content, all services mentioned in the file can be started from its folder with one command: "docker-compose up"
root@server:~/# docker-compose up
Creating network "test_default" with the default driver
Creating test_app_1 ... done
Attaching to test_app_1
To start more services from the text file, they can be added as additional services:
services:
app:
image: docker/getting-started
ports:
- 8080:80
app2:
image: docker/getting-started
ports:
- 8081:80
Step by step guide published as YouTube video
Docker-Webservices, examples
Here is a list of web services I have tested so far:
- Nextcloud , see : Nextcloud Server Docker | Setup + https: Let's Encrypt [ssl]
- Docker Mailserver, see : Running Docker Mailserver yourself | a field report
- Home Assistant, see : All about Home Assistant: Setup + Integration + Operation
- Gitea, see : Lean and fast GIT server, similar to GitHub (Docker)
- GitLab, see : Self-hosting GIT repositories: launch GitLab as a Docker container
- webhookd, see : Docker WebHook Daemon: simple hook server for bash scripts
- Laravel, see : my docker web server setup for laravel - config in detail
- Bitwarden, see : Running Bitwarden in Docker - Setup step by step
- WordPress, see : WordPress in Docker incl. HTTPS Let's Encrypt setup
- Portainer, see : Docker Container GUI graphical web interface with Portainer
- Matomo, see : Visitor statistics: Matomo, Google Analytic replacement self-hosting
- Uptime Kuma, see : Monitor websites with Uptime Kuma

{{percentage}} % positive

THANK YOU for your review!
Top articles in this section
In preparation for moving my websites, I was looking for a way to simply forward all traffic from the old server to the new one.
In my article "All Docker containers: Moving hosts, theory and practice", I already went a little bit into the topic of backup. If you followed the article, you know that I outsource the data of my Docker containers via bind mounts and back them up with rsync. The backup job is started via crontab. But first, I thought about what actually needs to be backed up when using Docker in a single-server setup.
Docker Swarm allows nodes (hosts) to be grouped together into a common federation. This allows containers to be run in any number of instances on any number of nodes (hosts) in the network. In Docker Swarm, the basis for communication between hosts is an overlay network for services: Multi-host networking. As indicated in my article on moving web servers, I tested Docker Swarm as a possible option for a shared cross-host network and gathered some insights on this, which I briefly summarize her...