Dedicated server

How to install Docker Community Edition on Ubuntu Bionic Beaver?

How to install Docker Community Edition on Ubuntu Bionic Beaver?

For many people, container virtualization is inextricably linked to Docker. This software is used by such large companies as ING, PayPal, ADP, and Spotify, and they have no plans of abandoning it. We have previously written about virtualization and different types of this technology. Make sure to get acquainted with the information presented in this article. Today we will focus on container virtualization and the Docker Community Edition platform. Besides, we will tell you how to install it on Ubuntu Bionic Beaver.

What is container virtualization?

To begin with, let's get acquainted with some basic terms.

Virtualization is a set of software technologies that enable applications to run on virtual hardware or OS. Сomputational processes are completely isolated in one medium. Thus, virtualization makes it possible for you to split a physical server into several isolated virtual ones.

There are 3 types of technology: software, hardware, and container. The last one, also called containerization, is virtualization at the operating system level.

In hardware and software technologies a hypervisor (or virtual machine manager) is used to separate processes. This is software that creates and runs virtual machines. This is an intermediate-level component between the physical equipment and the VM. Inside each of them, there is a unique guest OS. VMs with different operating systems can operate on a single server. Each virtual machine has its own libraries and applications.

Container virtualization differs greatly from hardware and software virtualization. The host OS is responsible for resource isolation when containerization.

A container is a virtual environment that emulates the underlying OS and shares a core with it. It contains all the necessary applications and all their surroundings.

Unlike hardware or software varieties of virtualization, it is necessary for the cores of the guest and the base operating systems to be of the same type.

Containerization through Docker Software

You can use one of the available implementations to run container virtualization. Docker is considered to be the most popular one. This is a software that enables you to create, deploy, and run various applications using container virtualization technology.

What are the peculiarities of containers one can create via Docker?

  • They do not take too much space, being created and launched within short time limits.
  • They ensure resource independence, as they are completely isolated from each other, so no Docker container can view processes running inside the other.
  • They can be deployed in seconds, as the operating system at startup is emulated, but not booted.

The company offers users two products, both based on Docker Engine client-server application: Enterprise and Community Edition. To use Enterprise Edition, one will have to pay. This software is intended for corporate use, so the developers distribute it under the license. Nevertheless, the Community Edition is available for free, which makes it very popular among individual users.

Docker Community Edition overview

Docker CE is open-source software. One can download it for free from the Docker Store (unlike Enterprise Edition). Here are some peculiarities of CE Version:

  • it works on Windows 10, Mac, Azure and AWS, as well as on CentOS, Debian, Fedora, and Ubuntu;
  • it has a simple set of functions and components for efficient container creation and operation.

Docker Community Edition basic features can be supplemented with a variety of free and paid additions from Docker Cloud.

How to install Docker CE on Ubuntu Bionic Beaver: simple step-by-step instruction

So, we proceed to how to install Docker CE on Ubuntu Bionic Beaver. Here are the main requirements:

  • Ubuntu OS – version 18.04 Bionic Beaver;
  • Configured SSH key;
  • root rights or access to administration via sudo.

If fully compliant, you can start the installation. The entire algorithm depends on the method selected. There are 2 main ways: you can either download from the repository or install the downloaded package with the .deb extension.

Installation from repository process

To download Docker CE using this method, you should stick to the following algorithm:

  1. Before you start installing Docker Community Edition, you must uninstall all previous versions: sudo apt-get remove docker docker-engine docker.io. If the Docker was not previously installed, or it is deleted already, you can go to the next step immediately.
  2. Update the cache: sudo apt-get update.
  3. As Docker uses the HTTPS protocol for his repository, install all the necessary packages for apt to download those through a secure connection: sudo apt-get install apt-transport-https ca-certificates curl software-properties-common.
  4. Add the official Docker GPG key to apt: curl – fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -. Check its digital fingerprint having a look at the last 8 characters.
  5. Add a repository for Docker to apt. For x86-64 based architectures, use sudo add-apt-repository "deb [arch = amd64] https://download.docker.com/linux/ubuntu $ (lsb_release -cs) stable." On ARM servers, depending on the central processing unit architecture, you will have to replace amd64 with armhf or arm64.
  6. Update the apt cache: sudo apt-get update.
  7. Install the latest version of Docker Community Edition: sudo apt-get install docker-ce.
  8. Make sure Docker has been installed by running the Hello World container: sudo docker run hello-world.

To install the update, you should first run the sudo apt-get update command. Then just follow the installation algorithm having selected a new version.

Installing the downloaded .deb package

A user who has no options for using the repository to install the Docker engine has another option: downloading the .deb file for free and install it manually. This process is not complicated, so here is the step-by-step instruction for you to stick to:

  1. First of all, you should download the .deb file for Ubuntu Bionic Beaver in the Docker Engine version you would like to install.
  2. Having done it, install the package: sudo dpkg -i/path/to/package.deb. During the installation, you will have to replace the specified path with the one the file was downloaded to.
  3. Make sure that Docker Engine is installed correctly: sudo docker run hello-world. Via this command, the test image is loaded and run in the container.

If you install from a file every single time you update, then you'll have to download and reinstall the Docker engine each time.

The Ubuntu operating system uses systemd to manage its services. Docker has this configuration pre-installed, so it is possible for users to configure its run when turning on. To do this, you should use the sudo systemctl enable docker command. If you don't want the software to be run when turning on, you should use another command – sudo systemctl disable docker.

How to work with images in Docker Community Edition?

To run the container, an image is needed. There are many ready-made solutions in Docker registries. Docker Hub is one of the biggest. All images one can find there are saved by default, so each person can use those for free.

To find different images on Ubuntu, you have to enter sudo docker search ubuntu at the command prompt. Having done it, you will see all the possible variants on your screen. Use the sudo docker pull ubuntu command to load those. If you want all of the loaded images to be shown, use the sudo docker images command at the command prompt.

The image is launched via the following algorithm:

  1. First of all, you enter sudo docker run -it ubuntu. in the terminal window.
  2. Then, start updating the package index. To do this, you should use the apt update command.
  3. After this, install the runtime package. For example, for Node.js, you'll have to enter apt install nodejs -y command. Then check it entering node -v command.

To exit, use the exit command. That's it.

Customer retention: how to improve it and raise your income
Dedicated server

Customer retention: how to improve it and raise your income

It’s not always about new customers. While reaching potential clients who didn’t buy your products or services yet is necessary, working with existing ones

Media server: why do you need it and how to set it up?
Business solutions

Media server: why do you need it and how to set it up?

The media server is used to store movies, music, or personal photos. You can connect to it with the help of a local network from different media playback

3 popular FTP clients: choosing the best one
VPS

3 popular FTP clients: choosing the best one

To send files from your computer to your server or vice versa securely, you need an FTP client. But choosing it is not so easy, especially given a large number of