Getting started with Docker on Manjaro (Arch Linux)
19 Jun 2020, 10:19pm TZ +05:30
Let’s look at how to get started with docker on Manjaro (Arch Linux) .
We would be looking at the process of installing, configuring and testing docker based containerization technology.
Though one might find it easy to install docker, there are subtle nuances that one needs to watchout for.
1. Install docker #
Manjaro (Arch Linux) maintains the latest version of most software packages. Just make sure you have good internet connection.
Hence without worry execute the following:
|
|
This should install the latest version of docker.
Let’s verify if we have things installed correctly:
|
|
Errors tell a story #
Oh! Whats that last message ?
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
This might be a bit mispleading.
It’s the service daemon telling us containerd
has not started.
Whats containerd
?
#
containerd
is available as a daemon for Linux and Windows. It manages the complete container lifecycle of its host system, from image transfer and storage to container execution and supervision to low-level storage to network attachments and beyond.
Source : containerd
Technical jargon apart this is what allows docker to do Containerization.
Hence its quite important that it’s working.
Let’s look at this in the net section.
For more information of containerd
:
- https://containerd.io/
- https://github.com/containerd/containerd
- https://www.docker.com/blog/what-is-containerd-runtime/
2. Starting the docker Service #
We looked at the mystical error in the version
command.
Let’s now figure out how to fix this.
One of nice things about Manjaro (Arch Linux) is that
it does not enable all service by default.This kind of makes your system fast to boot and use.
@boseji’s Wisdom
|
|
Success with docker version command #
We have the things running correctly.
Since now we can also see Server
information.
Why Server and Client ? #
Well the docker
command is like a front-end or Client and
containerd
is a back-end or server.
2.a What if we wanted to start the docker service automatically ? #
That is possible. But I would consider it detrimental to Arch way of things.
|
|
3. Getting $USER
for docker
#
As you might have noticed, we are using sudo
.
In all docker
commands as well.
Using sudo
for system commands like systemctl
is alright.
But, for development it becomes a mess.
Let’s fix that by adding our user to the docker
user group.
|
|
This would allow us to use the docker
command without sudo
.
Note: After modifying the current user using above - One must restart the computer.
|
|
This time without the additional sudo
.
4. See if docker is working and hello-world
#
Well enough talk about versions and services. Let’s see if our precious install actually does some things.
The programming essential is called Hello World
.
We do have an Docker Image by that name. Let’s run it.
Note: To run the below commands you must have internet connected.
|
|
This was an output from running a container of the image hello-world
.
If you see this output your docker is Seaworthy captain!.
We have used a lot of jargon again. Let’s decode that in the next section.
5. Understanding the Anatomy of a container #
A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another. A Docker container image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings.
Source : Docker website
What about images ? #
Container images become containers at runtime and in the case of Docker containers - images become containers when they run on Docker Engine.
Source : Docker Website
Well that was convoluted !
To simply put - images are the source material for creating containers. They contain all the necessary information and configuration in one unit.
We can create multiple containers from the same image.
Each container will have unique operation context or execution environment. Even though they might be created from the same image.
For more insight visit: https://www.docker.com/resources/what-container
6. This is only the beginning of our Adventure with docker
#
Indeed, there are lot of applications and interesting ideas around Containerization. Docker has made our entry to this world much simpler.
I look forward to publishing more works related to docker.
As always, I look forward to your suggestion and comments. DM me on Mastodon .