- Install on Arch-based distributions
- Prerequisites
- Install Docker Desktop
- Launch Docker Desktop
- Next steps
- Getting started with Docker on Manjaro (Arch Linux)
- 1. Install docker #
- Errors tell a story #
- Whats containerd ? #
- 2. Starting the docker Service #
- Success with docker version command #
- Why Server and Client ? #
- 2.a What if we wanted to start the docker service automatically ? #
- 3. Getting $USER for docker #
- 4. See if docker is working and hello-world #
- 5. Understanding the Anatomy of a container #
- What about images ? #
- 6. This is only the beginning of our Adventure with docker #
- Как установить Docker на Manjaro 20
- Установка Docker на Manjaro 20 Nibia
- Шаг 1. Перед тем, как запустить руководство, приведенное ниже, убедитесь, что наша система обновлена:
- Шаг 2. Установка Docker на Manjaro 20.
- Шаг 3. Чтобы установить Docker, просто используйте следующую команду:
Install on Arch-based distributions
This topic discusses installation of Docker Desktop from an Arch package that Docker provides in addition to the supported platforms. Docker has not tested or verified the installation.
Prerequisites
To install Docker Desktop successfully, you must meet the system requirements.
Additionally, for non-Gnome Desktop environments, gnome-terminal must be installed:
$ sudo pacman -S gnome-terminal
Install Docker Desktop
- Install client binaries. Docker does not have an Arch package repository. Binaries not included in the package must be installed manually before installing Docker Desktop.
- Install Docker client binary on Linux. On Arch-based distributions, users must install the Docker client binary. Static binaries for the Docker client are available for Linux (as docker ).
- Download the Arch package from the release page.
- Install the package:
$ sudo pacman -U ./docker-desktop--arch>.pkg.tar.zst
Launch Docker Desktop
To start Docker Desktop for Linux, search Docker Desktop on the Applications menu and open it. This launches the Docker menu icon and opens the Docker Dashboard, reporting the status of Docker Desktop.
Alternatively, open a terminal and run:
$ systemctl --user start docker-desktop
When Docker Desktop starts, it creates a dedicated context that the Docker CLI can use as a target and sets it as the current context in use. This is to avoid a clash with a local Docker Engine that may be running on the Linux host and using the default context. On shutdown, Docker Desktop resets the current context to the previous one.
The Docker Desktop installer updates Docker Compose and the Docker CLI binaries on the host. It installs Docker Compose V2 and gives users the choice to link it as docker-compose from the Settings panel. Docker Desktop installs the new Docker CLI binary that includes cloud-integration capabilities in /usr/local/bin/com.docker.cli and creates a symlink to the classic Docker CLI at /usr/local/bin .
After you’ve successfully installed Docker Desktop, you can check the versions of these binaries by running the following commands:
$ docker compose version Docker Compose version v2.17.3 $ docker --version Docker version 23.0.5, build bc4487a $ docker version Client: Docker Engine - Community Cloud integration: v1.0.31 Version: 23.0.5 API version: 1.42
To enable Docker Desktop to start on login, from the Docker menu, select Settings > General > Start Docker Desktop when you log in.
Alternatively, open a terminal and run:
$ systemctl --user enable docker-desktop
To stop Docker Desktop, select the Docker menu icon to open the Docker menu and select Quit Docker Desktop.
Alternatively, open a terminal and run:
$ systemctl --user stop docker-desktop
Next steps
- Take a look at the Get started training modules to learn how to build an image and run it as a containerized application.
- Review the topics in Develop with Docker to learn how to build new applications using Docker.
Getting 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:
# Install Docker main Package sudo pacman -Syyu docker .
This should install the latest version of docker.
Let’s verify if we have things installed correctly:
1 2 3 4 5 6 7 8 9 10 11 12
# To check the version of docker installed sudo docker version # Output Client: Version: 19.03.11-ce API version: 1.40 Go version: go1.14.3 Git commit: 42e35e61f3 Built: Tue Jun 2 15:09:26 2020 OS/Arch: linux/amd64 Experimental: false Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
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.
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 :
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
# Start docker service sudo systemctl start docker . # Let's now run the version command sudo docker version # Here is new output Client: Version: 19.03.11-ce API version: 1.40 Go version: go1.14.3 Git commit: 42e35e61f3 Built: Tue Jun 2 15:09:26 2020 OS/Arch: linux/amd64 Experimental: false Server: Engine: Version: 19.03.11-ce API version: 1.40 (minimum version 1.12) Go version: go1.14.3 Git commit: 42e35e61f3 Built: Tue Jun 2 15:09:05 2020 OS/Arch: linux/amd64 Experimental: false containerd: Version: v1.3.4.m GitCommit: d76c121f76a5fc8a462dc64594aea72fe18e1178.m runc: Version: 1.0.0-rc10 GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd docker-init: Version: 0.18.0 GitCommit: fec3683
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.
# Enable docker service permanently sudo systemctl enable docker
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.
# Add current user to 'docker' group sudo usermod -aG docker $USER .
This would allow us to use the docker command without sudo .
Note: After modifying the current user using above — One must restart the computer.
# After Restart we can check the version again docker version
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.
1 2 3 4 5 6 7 8 9 10 11 12
# Run the image 'hello-world' docker run --rm hello-world # Output nable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world 0e03bdcc26d7: Pull complete Digest: sha256:d58e752213a51785838f9eed2b7a498ffa1cb3aa7f946dda11af39286c3db9a9 Status: Downloaded newer image for hello-world:latest Hello from Docker! This message shows that your installation appears to be working correctly. .
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.
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.
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.
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 .
Как установить Docker на Manjaro 20
В этом руководстве мы покажем вам, как установить Docker на Manjaro 20. Для тех из вас, кто не знал, Docker — это проект с открытым исходным кодом, который автоматизирует развертывание приложения внутри программного контейнера. Контейнер позволяет разработчику упаковать все ресурсы проекта, такие как библиотеки, зависимости, активы и т. Д. Docker написан на языке программирования Go и разработан Dot cloud. По сути, это механизм контейнеров, который использует функции ядра Linux, такие как пространства имен и группы управления, для создания контейнеров поверх операционной системы и автоматизирует развертывание приложений в контейнере.
В этой статье предполагается, что у вас есть хотя бы базовые знания Linux, вы знаете, как использовать оболочку, и, что наиболее важно, вы размещаете свой сайт на собственном VPS. Установка довольно проста и предполагает, что вы работаете с учетной записью root, в противном случае вам может потребоваться добавить ‘ sudo ‘ к командам для получения привилегий root. Я покажу вам пошаговую установку Docker на Manjaro 20 ( Nibia ).
Установка Docker на Manjaro 20 Nibia
Шаг 1. Перед тем, как запустить руководство, приведенное ниже, убедитесь, что наша система обновлена:
Шаг 2. Установка Docker на Manjaro 20.
После завершения установки запустите службу Docker и включите ее автоматический запуск после перезагрузки системы:
sudo systemctl start docker.service sudo systemctl enable docker.service
Выполните следующую команду, чтобы установить пакеты Snap
sudo pacman -S snapd sudo systemctl enable --now snapd.socket sudo ln -s /var/lib/snapd/snap /snap
Шаг 3. Чтобы установить Docker, просто используйте следующую команду:
После установки будет создана группа докеров. Добавьте своего пользователя в группу, которая будет запускать команды докеров:
sudo usermod -aG docker $USER
После этого проверьте установку Docker, используя следующую команду:
Поздравляю! Вы успешно установили Docker . Благодарим за использование этого руководства по установке Docker в системах Manjaro 20. Для получения дополнительной помощи или полезной информации мы рекомендуем вам посетить официальный сайт Docker .