Install Docker on Ubuntu 16.04
Docker is associate ASCII text file software package tool designed to alter and ease the method of making, packaging, associated deploying applications victimization surroundings known as an instrumentality. the employment of UNIX system containers to deploy applications is named containerization.
An instrumentality permits U.S.A. to package associate application with all of the components required to run associate application (code, system tools, logs, libraries, configuration settings and different dependencies) and sends it out as one standalone package deploy able via Ubuntu (in this case sixteen.04 LTS). loader may be put in on different platforms still. Currently, the loader software package is maintained by the loader community and loader Iraqi National Congress. check up on the official documentation to search out a lot of specifics on loader. loader Terms and ideas
Docker is formed from many components:
Docker for UNIX system: software package that runs loader containers on the Ubuntu Linux OS.
Docker Engine: Used for building loader pictures and making loader containers.
Docker Registry: accustomed store varied loader pictures.
Docker Compose: accustomed outline applications victimization multiple loader containers.
Some of the opposite essential terms and ideas you may inherit contact with are:
Containerization: Containerization could be a light-weight different to full machine virtualization (like VMWare) that involves encapsulating associate application among a instrumentality with its own operational surroundings.
Docker conjointly uses pictures and containers. the 2 concepts area unit closely connected, however terribly distinct.
Docker Image: A loader Image is that the basic unit for deploying a loader instrumentality. A loader image is basically a static exposure of a instrumentality, incorporating all of the objects required to run a instrumentality.
Docker instrumentality: A loader Container encapsulates a loader image and once live and running, is taken into account a instrumentality. every instrumentality runs isolated within the host machine.
Docker written record: The loader Registry could be a unsettled, extremely ascendable server-side application that stores and distributes loader pictures. This written record holds loader pictures, beside their versions and, it will offer each public and personal storage location. there’s a public loader written record known as loader Hub that provides a free-to-use, hosted written record, and extra options like organization accounts, automatic builds, and more. Users move with a written record by victimization loader push or pull commands.
- Docker Engine: The Docker Engine is a layer which exists between containers and the Linux kernel and runs the containers. It is also known as the Docker daemon. Any Docker container can run on any server that has the Docker-daemon enabled, regardless of the underlying operating system.
- Docker Compose: Docker Compose is a tool that defines, manages and controls multi-container Docker applications. With Compose, a single configuration file is used to set up all of your application’s services. Then, using a single command, you can create and start all the services from that file.
- Dockerfiles: Dockerfiles are merely text documents (.yaml files) that contains all of the configuration information and commands needed to assemble a container image. With a Dockerfile, the Docker daemon can automatically build the container image.
Example: The following basic Dockerfile sets up an SSHd service in a container that you can use to connect to and inspect other containers volumes, or to get
- quick access to a test container.
There are three versions of Docker available, each with its own unique use:
- Docker CE is the simple, classic Docker Engine.
- Docker EE is Docker CE with certification on some systems and support by Docker Inc.
- Docker CS (Commercially Supported) is kind of the old bundle version of Docker EE for versions <= 1.13.
We will be installing Docker CE.
Step 1 — Checking Prerequisites
To begin, start with the following server environment:
- 64-bit Ubuntu 16.04 server
- Logged in as the root user
Step 2 — Installing Docker
The next step is to remove any default Docker packages from the existing system before installing Docker on a Linux VPS. Execute the following commands to start this process:
In certain instances, a specific variant of the linux kernel is slimmed down by removing less common modules (or drivers). If this is the case, the “linux-image-extra” package contains all of the “extra” kernel modules which were left out. Use this command to re-add them:
Step 3 — Add required packages
Now, we need to install some required packages on your system. Run the commands below to accomplish this:
If you get the error: “E: Unable to locate package curl”, Use the commands “curl -V” to see if curl is already installed; if so, move on to step 4
Step 4 — Verify, Add and Update Repositories
Add the Docker GPG key to your system:
Next, update the APT sources to add the source:
Run the update again so the Docker packages are recognized:
Let’s rerun the update:
success! Now, verify we are installing Docker from the correct repo instead of the default Ubuntu 16.04 repo:
Step 5 — Install Docker
Finally, let’s start the Docker install:
Docker should now be installed, the daemon started, and the process enabled to start on boot. Let’s check to see if it’s running:
Excellent! Good to go!
If Docker is not started automatically after the installation, run the following commands:
Step 6 — Test Docker
Let’s check the new Docker build by downloading the hello-world test image.
To start testing, issue the following command:
Step 7 — The ‘Docker’ Command
With Docker installed and working, now is the time to become familiar with the command line utility. The ‘Docker’ command consists of using Docker with a chain of options followed by arguments. The syntax takes this form:
To view all of the available Options and Management Commands, simply type:
To view the switches available for a specific command, type:
Lastly, To view system-wide information about Docker, use:
Docker is a dynamic, robust and responsive tool that makes it very simple to run applications within a containerized environment. It is portable, less resource-intensive, and more reliant on the host operating system which allows for multiple uses. Overall, Docker is a ‘must have’ system and should be included in your toolkit for automation, deployment, and scaling of your applications!
Our Support Teams are filled with talented admins with an intimate knowledge of multiple web hosting technologies, especially those discussed in this article. If you are uncomfortable walking through the steps outlined here, we are a phone call, chat or ticket away from assisting you with this process. If you’re running one of our fully Managed Cloud VPS Servers, we can provide more information on directly implementing the software described in this article.