Arch linux docker sudo

How to Install and Use Docker on Arch Linux

The goal of Docker is to make the creation, distribution, and running of the applications in containers easier. On Arch Linux, Docker may be used to execute the containerized apps outside of the host system in a user-specified domain. Separating the application from the host machine improves consistency and repeatability when delivering the applications and increases security. Furthermore beneficial for development and testing, Docker may be used to handle numerous separate environments on a single system.

Update the Arch Linux

It’s time to update our Arch Linux with all of its utilities. The “sudo pacman -Syu” command is used on an Arch Linux shell to update the system’s packages. The “sudo” command allows the user to run the subsequent “pacman -Syu” command with superuser (administrator) privileges. The “-S” flag tells pacman to sync (install or update) the packages. The “y” flag tells it to refresh the package lists. And the “u” flag tells it to perform a full system upgrade. The output shows that pacman first synchronizes the package databases for the “core”, “extra”, and “community” repositories. It then proceeds with the full system upgrade. It reports the total number of packages that are upgraded, the total download and installed size of those packages, and the net upgrade size. It then asks the user for confirmation to proceed with the installation (“Proceed with installation? [Y/n] y”).

Create a Loop Component

A standard file or block device can be employed as a virtual block device with the help of the loop component, a kernel module. This may be used for encryption, compression, and the creation of file-based virtual disc images. The “loop.conf” file contains the “loop” string as its only content. This is typically used to load the modules automatically at boot time. The following command is used to create a new configuration file called “loop.conf” in the “/etc/module-load.d” directory. Using the “tee” command, you can read from the standard input and output to one or more files as well as standard output. In this case, the command writes the “loop” string to a new file called “loop.conf” in the “/etc/module-load.d” directory. The “

[ omar @ omar ~ ] $ sudo tee / etc / module-load.d / loop.conf <<< "loop"
[ sudo ] password for omar:
tee: / etc / module-load.d / loop.conf: No such file or directory
loop

The modprobe loop command is used to load the kernel module for loop devices. When the modprobe command is executed with the loop argument, it checks to see if the loop module is already loaded in the kernel. If it is not, the command loads the module into the kernel, making it available for use. Once the module is loaded, it can be used to create the loop devices.

Читайте также:  Hash all files linux

Install the Docker

The following pacman instruction is here to install the Docker package on a computer running Arch Linux. The pacman command uses the -S flag to specify that the command installs a package. The command indicates that the package is already installed and is up to date. Therefore, it reinstalls the package. Once the package is installed successfully, the command runs some post-transaction hooks.

[ omar @ omar ~ ] $ sudo pacman -S docker
warning: docker- 1 :20.10.23- 1 is up to date — reinstalling
resolving dependencies.
looking for conflicting packages.
Packages ( 1 ) docker- 1 :20.10.23- 1
Total Installed Size: 113.55 MiB
Net Upgrade Size: 0.00 MiB
:: Proceed with installation? [ Y / n ] y
:: Processing package changes.
( 1 / 1 ) reinstalling docker [ ######################] 100%
:: Running post-transaction hooks.
( 1 / 4 ) Creating system user accounts.
( 2 / 4 ) Reloading system manager configuration.
( 3 / 4 ) Reloading device manager configuration.
( 4 / 4 ) Arming ConditionNeedsUpdate.

Clone the Docker

It’s time to clone the Docker’s official repository from Git which is a repository that is located at the specified URL. The command creates a new directory called “docker-git” and copies the entire contents of the remote repository to the local machine. It starts by enumerating the objects in the remote repository. Then, it counts and compresses them.

Install the Base-Devel

The following command is used to install the base-devel package group on a computer running Arch Linux. It is a meta package that contains the basic development tools. It contains a set of packages that provide the tools which are necessary to build and develop the Arch Linux packages. Tools like the GNU Compiler Collection (GCC), GNU Binutils, and the GNU Build System are part of this package category (automake, autoconf, etc.). The command shows that there are 26 members in the group base-devel and it lists them. It also asks the user to select which package to install. By default, it installs all of them. Once the user confirms with “y”, the package is installed and the command gives a progress bar which indicates the status of the installation.

[ omar @ omar ~ ] $ sudo pacman -S base-devel
:: There are 26 members in group base-devel:
:: Repository core
1 ) archlinux-keyring 2 ) autoconf 3 ) automake 4 ) binutils 5 ) bison
6 ) debugedit 7 ) fakeroot 8 ) file 9 ) findutils 10 ) flex 11 ) gawk
12 ) gcc 13 ) gettext 14 ) grep 15 ) groff 16 ) gzip 17 ) libtool 18 ) m4
19 ) make 20 ) pacman 21 ) patch 22 ) pkgconf 23 ) sed 24 ) sudo 25 ) texinfo
26 ) which
Enter a selection ( default =all ) :
warning: archlinux-keyring- 20221220 — 1 is up to date — reinstalling
warning: autoconf- 2.71 — 1 is up to date — reinstalling
looking for conflicting packages.
Packages ( 26 )
Total Installed Size: 272.07 MiB
Net Upgrade Size: 0.00 MiB
:: Proceed with installation? [ Y / n ] y
:: Processing package changes.
== > Appending keys from archlinux.gpg.
== > Updating trust database.
gpg: next trustdb check due at 2023 -04- 21
== > Updating trust database.
:: Running post-transaction hooks.
( 1 / 4 ) Reloading system manager configuration.
( 2 / 4 ) Creating temporary files.
( 3 / 4 ) Arming ConditionNeedsUpdate.
( 4 / 4 ) Updating the info directory file.

The following command is used to change the current working directory to a directory called “docker-git” that is created by the user “omar” and contains the files or subdirectories which are related to the use of Docker and Git which we just created in the previous illustrations.

Читайте также:  Linux change default route metric

Build the Docker

The “makepkg” command is used to build the packages for Arch Linux and its derivatives. The “-s” flag is used to indicate that the package should be built using the source code rather than pre-compiled binaries. The “-r” flag is used to indicate that the package should be installed automatically after it is built. The “i” flag is used to indicate that any existing package with the same name should be overwritten. The output of the command shows that the process checks the runtime and build-time dependencies. Then, it’s going to retrieve the sources. After that, it clones two Git repositories, one is “moby” and the other one is “docker-ce”, both are cloned into the “docker-git” directory.

Now, you need to enable the Docker service using the following systemctl instruction:

Use the following instruction to launch the Docker:

Conclusion

This article elaborates on the use of Docker in Arch Linux with the help of its introductory paragraph. After updating our Arch Linux system, we created a new loop configuration file followed by the modprobe loop instruction that is utilized to load the kernel module for loop devices. Then, we installed the Docker package and cloned the docker-git repository in Arch Linux. After building the packages for docker-git, we successfully installed the Docker.

About the author

Omar Farooq

Hello Readers, I am Omar and I have been writing technical articles from last decade. You can check out my writing pieces.

Источник

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

  1. 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.
  2. 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 ).
  3. Download the Arch package from the release page.
  4. 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.

Читайте также:  Linux echo without newline

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.

Источник

Как использовать Docker в Arch Linux

Сегодня давайте посмотрим на использование Docker в Arch Linux — элитном дистрибутиве Linux для избранных!

Список возможностей Docker довольно длинный. Все начинается с преимуществ контейнеров.

Контейнеры делают жизнь разработчиков и пользователей НАМНОГО проще, чем раньше. Традиционно программное обеспечение нужно было создавать, упаковывать и публиковать для потребителей. Эта задача была специфичной для платформы, а это означало, что программное обеспечение нужно было настраивать и перестраивать для каждой целевой платформы. Что еще хуже, зависимости могут вызывать большие проблемы от платформы к платформе. Двойная боль без пользы.

Docker с его контейнерной системой предлагает лучшее решение. Вместо того, чтобы создавать пакет для всех платформ, он создается только один раз. Что касается зависимостей, Docker упаковывает только самые необычные и необходимые. Таким образом, контейнеры Docker уменьшаются в размере для облегчения совместного использования. Со стороны разработчиков это сокращает время и усилия на обслуживание и улучшения. Они могут сосредоточиться только на кодировании пакета и не беспокоиться о целевой платформе.

Системным администраторам Docker предлагает централизованно управляемый и безопасный способ распространения критически важных приложений. В отличие от виртуализации, Docker обеспечивает более простое соединение с ядром хост-системы без необходимости промежуточной виртуализации. Это значительно повышает производительность по сравнению с виртуальными серверами.

Наверное, самое лучшее то, что это совершенно бесплатно! Docker — это проект с открытым исходным кодом, который формирует отрасль. Из-за его влияния даже такие крупные фирмы, как Red Hat, Rackspace и Microsoft, работают с Docker!

Docker на Arch Linux

Установка Docker

Благодаря своей огромной популярности и преимуществам Docker теперь является официальным пакетом коллекции пакетов Arch Linux. Не нужно возиться с AUR.

Сначала убедитесь, что система обновлена.

Источник

Оцените статью
Adblock
detector