как установить docker на linux mint 20
How to Install Docker on Linux Mint
In the case of Linux, there are numerous ways that an app can be enjoyed. That can bring a lot of confusion and issues. For example, Debian, Ubuntu and other Debian/Ubuntu-based distros like Linux Mint use DEB packages as installable apps. For CentOS and RHEL, it’s RPM.
When a dev is working on an app, he has to keep that in mind. The fact that different Linux ecosystems work differently puts a hefty amount of stress on the development process. Why?
Let’s make things clear with an example. You generally can’t run a package that’s built for Debian/Ubuntu ecosystem on any other systems like CentOS and RHEL. The opposite is also true. The problem can be avoided using various techniques. But at the enterprise level, there has to be something that makes this type of action really easy.
This is where Docker comes into play. There are also other ways of enjoying universal Linux apps like snap. Learn how to use snap packages on Ubuntu and Ubuntu-based distros.
What Docker is
So, what is Docker? Docker is a special tool that’s designed especially for easier creation, deployment, and running Linux apps using “containers”. In Docker’s terms, “containers” are a pre-bundled environment where Linux apps can run in an expected and repeatable fashion. The containers come up with all the essential resources (libraries and other dependencies). This allows the same container to run on every supported Linux platform.
As you can guess, this makes things A LOT easier for the developer. Being free from the concern of portability, devs can focus fully on the app itself and make it way better.
In a sense, Docker works like a virtual machine. However, it’s significantly different at the core level. In the case of virtualization, the “guest” environment is created on top of the “host”. However, in the case of Docker, containers are allowed to access hardware resource directly via the host’s kernel, especially on the Linux systems. In addition, only those packages that are not available on the “host” system is packed inside Docker. Both of these features together offer a huge boost in both performance and the size of each containers (smaller and lighter).
So, why use Docker? It’s open-source with a HUGE community behind it. It has already found its place in the professional workspace. It’s also possible to extend the features of Docker to meet anyone’s needs and add additional features that don’t arrive out-of-the-box.
However, for developing a Docker container, the security has to be ensured. Docker offers quite good security measurements for apps running in such a shared environment. However, containers, by themselves, aren’t an alternative to taking full-fledged security measures.
Who is Docker for?
Docker is a tool that’s meant to benefit the full set of modern IT and software development professionals including the newish field of DevOps.
For software developers, Docker is a big relief. There’s no more necessary for worrying about cross-platform compatibility. With thousands of already-available apps, developers can get a head start in their Docker container development.
For operations and staff, Docker offers the ultimate flexibility. It potentially reduces the number of systems necessary. Docker itself creates only a small footprint and lower overhead.
Getting Docker on Linux Mint
For Linux devs/users, Docker can become an integral part. Using Docker, it’s possible to perform seemingly impossible tasks with ease.
In the case of Linux Mint, let’s get Docker ready!
Installing Docker from repo
Note – I’ll be installing Docker CE (Community Edition) for the guide. It’s free and open-source with extreme flexibility for both developers and small teams. For getting started with Docker, Docker CE is the best spot.
At first, it’s STRONGLY recommended to make sure that there’s no version of Docker installed previously.
It’s completely okay to have none of these packages installed previously.
Make sure that APT cache is up-to-date.
By default, APT doesn’t use HTTPS. Install the following packages that will allow APT to use a repository over HTTPS.
For enabling the Docker repo, the official Docker key is important. Time to add the official GPG key of Docker into the APT keyring.
Even after the successful addition of the key, it’s safe to verify the key. Run the following command –
In the case of Docker, there are 3 different repositories – “stable” (recommended for everyone), “nightly” or “test”. Let’s configure the “stable” repo.
Note – If you wish to configure any other repo (nightly or test), just change the “stable” from the command into “nightly” or “test” (without quotes).
Once the repositories have been added, it’s necessary to refresh the APT cache again.
Finally, install the latest version of Docker CE and containerd.
Optional
If you’re interested in a certain version of Docker CE, then follow the following procedures.
Run the following command for listing all the available versions –
Once you’ve made your mind, time to install that version! Run the following command –
Here, the should be replaced with something like “18.06.0
ubuntu” (without quotes).
Installing Docker using DEB
Docker is also kind enough to provide an installable DEB package for Debian, Ubuntu and derivatives.
Note – In my case (Linux Mint 19.1 Tessa, based on Ubuntu 18.04 Bionic), I have to choose Bionic. Depending on your Linux Mint version, this may differ. Check out all the available package base for Linux Mint.
Go to pool >> stable.
Now, download the latest versions of containerd and docker-ce-cli or docker-ce.
Install them using APT –
Verifying Docker installation
Run the following command from a terminal –
According to the message, this command is the surefire way of verifying a successful Docker installation.
About the author
Sidratul Muntaha
Student of CSE. I love Linux and playing with tech and gadgets. I use both Ubuntu and Linux Mint.
Как установить Docker на Linux Mint 20
Как установить Docker на Linux Mint 20
В этом руководстве мы покажем вам, как установить Docker на Linux Mint 20. Для тех из вас, кто не знал, Docker — это проект с открытым исходным кодом, который автоматизирует развертывание приложения внутри программного контейнера. Контейнер позволяет разработчику упаковать все ресурсы проекта, такие как библиотеки, зависимости, активы и т. Д. Docker написан на языке программирования Go и разработан Dot cloud. По сути, это механизм контейнеров, который использует функции ядра Linux, такие как пространства имен и группы управления, для создания контейнеров поверх операционной системы и автоматизирует развертывание приложений в контейнере.
В этой статье предполагается, что у вас есть хотя бы базовые знания Linux, вы знаете, как использовать оболочку, и, что наиболее важно, вы размещаете свой сайт на собственном VPS. Установка довольно проста и предполагает, что вы работаете с учетной записью root, в противном случае вам может потребоваться добавить ‘ sudo ‘ к командам для получения привилегий root. Я покажу вам пошаговую установку Docker на Linux Mint 20 (Ульяна).
Установить Docker на Linux Mint 20 Ulyana
Шаг 1. Перед запуском приведенного ниже руководства важно убедиться, что ваша система обновлена, выполнив следующие apt команды в терминале:
Шаг 2. Установка Docker на Linux Mint 20.
Выполните следующую команду, чтобы установить пакеты Snap и Docker:
Чтобы установить Docker, просто используйте следующую команду:
Теперь мы добавляем официальный ключ Docker в вашу систему Linux Mint:
Шаг 3. Затем добавьте репозиторий Docker в Linux Mint:
Шаг 4. Затем установите Docker CE с помощью следующей команды:
После установки будет создана группа докеров. Добавьте своего пользователя в группу, которая будет запускать команды докеров:
После этого проверьте установку Docker, используя следующую команду:
Docker используется с синтаксисом, как показано ниже:
Как установить Docker на Linux Mint
В случае Linux существует множество способов использования приложения. Это может вызвать путаницу и проблемы. Например, Debian, Ubuntu и другие дистрибутивы на основе Debian/Ubuntu, такие как Linux Mint, используют пакеты DEB в качестве устанавливаемых приложений. Для CentOS и RHEL это RPM.
Когда разработчик работает над приложением, он должен помнить об этом. Тот факт, что разные экосистемы Linux работают по-разному, сильно нагружает процесс разработки. Почему?
Давайте проясним ситуацию на примере. Обычно вы не можете запускать пакет, созданный для экосистемы Debian/Ubuntu, на других системах, таких как CentOS и RHEL. Обратное тоже верно. Избежать проблемы можно разными способами. Но на уровне предприятия должно быть что-то, что действительно упрощает этот тип действий.
Вот где в игру вступает Docker. Есть и другие способы пользоваться универсальными приложениями Linux, такими как snap. Узнайте, как использовать пакеты snap в дистрибутивах Ubuntu и Ubuntu.
Что такое Docker
Итак, что такое Docker? Docker — это специальный инструмент, разработанный специально для упрощения создания, развертывания и запуска приложений Linux с использованием «контейнеров». В терминах Docker, «контейнеры» — это предварительно объединенная среда, в которой приложения Linux могут работать ожидаемым и повторяемым образом. В контейнерах есть все необходимые ресурсы (библиотеки и другие зависимости). Это позволяет запускать один и тот же контейнер на каждой поддерживаемой платформе Linux.
Как вы можете догадаться, это НАМНОГО упрощает работу разработчика. Не заботясь о переносимости, разработчики могут полностью сосредоточиться на самом приложении и улучшить его.
В некотором смысле Docker работает как виртуальная машина. Однако на базовом уровне все существенно иначе. В случае виртуализации «гостевая» среда создается поверх «хоста». Однако в случае Docker контейнерам разрешен доступ к аппаратным ресурсам напрямую через ядро хоста, особенно в системах Linux. Кроме того, внутри Docker упаковываются только те пакеты, которые недоступны в «хост-системе». Обе эти функции вместе предлагают огромный прирост как производительности, так и размера каждого контейнера (меньше и легче).
Итак, зачем использовать Docker? Это открытый исходный код, за которым стоит ОГРОМНОЕ сообщество. Он уже нашел свое место в профессиональном рабочем пространстве. Также возможно расширить функции Docker для удовлетворения любых потребностей и добавить дополнительные функции, которые не появляются в готовом виде.
Однако для разработки контейнера Docker безопасность имеет быть обеспеченным. Docker предлагает неплохие показатели безопасности для приложений, работающих в такой общей среде. Однако сами по себе контейнеры не являются альтернативой полноценным мерам безопасности.
Для кого Docker?
Docker — это инструмент, предназначенный для использования всеми современными ИТ-специалистами и разработчиками программного обеспечения, включая новую область DevOps.
Для разработчиков программного обеспечения Docker — большое облегчение. Больше не нужно беспокоиться о кроссплатформенной совместимости. Благодаря тысячам уже доступных приложений разработчики могут начать разработку своих контейнеров Docker.
Для операций и персонала Docker предлагает максимальную гибкость. Это потенциально снижает количество необходимых систем. Сам Docker занимает мало места и снижает накладные расходы.
Получение Docker на Linux Mint
Для разработчиков/пользователей Linux — Docker может стать неотъемлемой частью. Используя Docker, можно легко выполнять казалось бы невозможные задачи.
В случае Linux Mint давайте подготовим Docker!
Установка Docker из репозитория
Примечание. Я буду устанавливать Docker CE (Community Edition) в качестве руководства. Это бесплатное приложение с открытым исходным кодом, обеспечивающее исключительную гибкость как для разработчиков, так и для небольших команд. Для начала работы с Docker лучше всего подойдет Docker CE.
Во-первых, НАСТОЯТЕЛЬНО рекомендуется убедиться, что ранее не было установленной версии Docker.
Совершенно нормально, если ни один из этих пакетов ранее не был установлен.
Убедитесь, что кеш APT обновлен.
По умолчанию APT не использует HTTPS. Установите следующие пакеты, которые позволят APT использовать репозиторий через HTTPS.
Для включения репозитория Docker важен официальный ключ Docker. Пора добавить официальный ключ GPG Docker в связку ключей APT.
Даже после успешного добавления ключа его можно безопасно проверить. Выполните следующую команду —
Примечание. Если вы хотите настроить любое другое репо (ночное или тестовое), просто измените «стабильный» из команды на «nightly» или «test» (без кавычек).
После того, как репозитории были добавлены, необходимо снова обновить кеш APT.
Наконец, установите последнюю версию Docker CE и containerd.
Необязательно
Если вас интересует определенная версия Docker CE, выполните следующие процедуры.
Выполните следующую команду для вывода списка всех доступных версий —
После того, как вы сделали ваш разум, пора установить эту версию! Выполните следующую команду —
Здесь следует заменить на что-то вроде «18.06.0
ubuntu» (без кавычек).
Установка Docker с использованием DEB
Docker также достаточно любезен, чтобы предоставить устанавливаемый пакет DEB для Debian, Ubuntu и производных.
Получить пакет Docker CE DEB для Linux Mint.
Примечание. В моем случае (Linux Mint 19.1 Tessa, основанный на Ubuntu 18.04 Bionic) я должен выбрать Bionic. Это может отличаться в зависимости от вашей версии Linux Mint. Ознакомьтесь со всей доступной базой пакетов для Linux Mint .
Перейти к пулу >> стабильный.
Теперь загрузите последние версии containerd и docker-ce-cli или docker-ce.
Установите их с помощью APT —
Проверка установки Docker
Выполните следующую команду из терминала —
Согласно сообщению, эта команда является верным способом проверки успешной установки Docker.
Install Docker Engine
Estimated reading time: 7 minutes
Docker Desktop for Linux
Docker Desktop helps you build, share, and run containers easily on Mac and Windows as you do on Linux. Docker handles the complex setup and allows you to focus on writing the code. Thanks to the positive support we received on the subscription updates, we’ve started working on Docker Desktop for Linux which is the second-most popular feature request in our public roadmap. If you are interested in early access, sign up for our Developer Preview program.
Supported platforms
Docker Engine is available on a variety of Linux platforms, macOS and Windows 10 through Docker Desktop, and as a static binary installation. Find your preferred operating system below.
Desktop
Server
Platform | x86_64 / amd64 | arm64 / aarch64 | arm (32-bit) | s390x |
---|---|---|---|---|
CentOS | В | В | ||
Debian | В | |||
Fedora | В | В | ||
Raspbian | В | В | В | |
RHEL | В | В | В | |
SLES | В | В | В | |
Ubuntu | ||||
Binaries | В |
Other Linux distributions
While the instructions below may work, Docker does not test or verify installation on derivatives.
Docker provides binaries for manual installation of Docker Engine. These binaries are statically linked and can be used on any Linux distribution.
Release channels
Docker Engine has three types of update channels, stable, test, and nightly:
Stable
In preparation for a new year-month release, a branch is created from the master branch with format YY.mm when the milestones desired by Docker for the release have achieved feature-complete. Pre-releases such as betas and release candidates are conducted from their respective release branches. Patch releases and the corresponding pre-releases are performed from within the corresponding release branch.
Nightly
Nightly builds give you the latest builds of work in progress for the next major release. They are created once per day from the master branch with the version format:
These builds allow for testing from the latest code on the master branch. No qualifications or guarantees are made for the nightly builds.
Support
Docker Engine releases of a year-month branch are supported with patches as needed for one month after the next year-month general availability release.
This means bug reports and backports to release branches are assessed until the end-of-life date.
After the year-month branch has reached end-of-life, the branch may be deleted from the repository.
Backporting
Backports to the Docker products are prioritized by the Docker company. A Docker employee or repository maintainer will endeavour to ensure sensible bugfixes make it into active releases.
If there are important fixes that ought to be considered for backport to active release branches, be sure to highlight this in the PR description or by adding a comment to the PR.
Upgrade path
Patch releases are always backward compatible with its year-month version.
Licensing
Docker is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.
Reporting security issues
The Docker maintainers take security seriously. If you discover a security issue, please bring it to their attention right away!
Please DO NOT file a public issue; instead send your report privately to security@docker.com.
Security reports are greatly appreciated, and Docker will publicly thank you for it.
Get started
After setting up Docker, you can learn the basics with Getting started with Docker.