Skip to main content

Install Docker on Ubuntu Using Default Repositories

Image result for docker logo

Docker is an increasingly popular software package that creates a container for application development.
Developing in Docker speeds up applications, as it shares the kernel and other resources, instead of requiring dedicated resources.
There are two versions of Docker – Docker CE (Community Edition) and Docker EE (Enterprise Edition). If you have a small-scale project, or you’re just learning, you’ll want to use Docker CE.
In this tutorial, we will cover how to install Docker on Ubuntu 18.04.



Docker
 is an increasingly popular software package that creates a container for application development.
Developing in Docker speeds up applications, as it shares the kernel and other resources, instead of requiring dedicated resources.
There are two versions of Docker – Docker CE (Community Edition) and Docker EE (Enterprise Edition). If you have a small-scale project, or you’re just learning, you’ll want to use Docker CE.
In this tutorial, we will cover how to install Docker on Ubuntu 18.04.
install docker on ubuntu 18.04
Prerequisites
  • Ubuntu 18.04 64-bit operating system
  • A user account with sudo privileges
  • Command line / terminal (CTRL-ALT-T or Applications menu > Accessories > Terminal)
  • Docker software repositories (optional)

Install Docker on Ubuntu Using Default Repositories

Step 1: Update Software Repositories

As usual, it’s a good idea to update the local database of software to make sure you’ve got access to the latest revisions.
Therefore, open a terminal window and type:
sudo apt-get update
Allow the operation to complete.

Step 2: Uninstall Old Versions of Docker

Next, it’s recommended to uninstall any old Docker software before proceeding.
Use the command:
sudo apt-get remove docker docker-engine docker.io

Step 3: Install Docker

To install Docker on Ubuntu, in the terminal window enter the command:
sudo apt install docker.io

Step 4: Start and Automate Docker

The Docker service needs to be setup to run at startup. To do so, type in each command followed by enter:
sudo systemctl start docker
sudo systemctl enable docker
enable docker command, in terminal

Step 5 (Optional): Check Docker Version

To verify the installed Docker version number, enter:
docker --version
checking version of docker installed in terminal

Note: The official Docker website does not offer support for Ubuntu 18.04. It’s possible that the Ubuntu default repositories have not updated to the latest revision. There’s nothing wrong with running this installation. However, if you are up for a slightly more intensive operation, you can install a more recent (or specific) Docker from the official Docker repositories.

Alternative: Install Docker from Official Repository

Step 1: Update Local Database

Update the local database with the command:
sudo apt-get update

Step 2: Download Dependencies

You’ll need to run these commands to allow your operating system to access the Docker repositories over HTTPS.
In the terminal window, type:
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
To clarify, here’s a brief breakdown of each command:
  • apt-transport-https: Allows the package manager to transfer files and data over https
  • ca-certificates: Allows the system (and web browser) to check security certificates
  • curl: This is a tool for transferring data
  • software-properties-common: Adds scripts for managing software

Step 3: Add Docker’s GPG Key

The GPG key is a security feature.
To ensure that the software you’re installing is authentic enter:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –
docker GPG key security in terminal

Step 4: Install the Docker Repository

To install the Docker repository, enter the command:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu  $(lsb_release -cs)  stable" 
The command “$(lsb_release –cs)” scans and returns the codename of your Ubuntu installation – in this case, Bionic. Also, the final word of the command – stable– is the type of Docker release.
example installation of the docker repository in terminal
A stable release is tested and confirmed to work, but updates are released less frequently. You may substitute edge if you’d like more frequent updates, at the cost of potential instability. There are other repositories, but they are riskier – more info can be found on the Docker web page.

Step 5: Update Repositories

Update the repositories you just added:
sudo apt-get update

Step 6: Install Latest Version of Docker

To install the latest version of docker:
sudo apt-get install docker-ce

Step 7 (Optional): Install Specific Version of Docker 

List the available versions of Docker by entering the following in a terminal window:
apt-cache madison docker-ce
list available docker version in terminal
The system should return a list of available versions as in the image above.
At this point, type the command:
sudo apt-get install docker-ce=<VERSION>
However, substitute <VERSION> for the version you want to install (pulled from the list you just generated).
For example:
installation of a specific version of docker in terminal

Step 8 (Optional): Install from a .deb Package

First, open a web browser, and go to the following web address:
Next, click on the pool link, then stable, then amd64.  This is the location of the stable Docker releases for Ubuntu 18.04.
stable docker releases index on links
At the time this article was written, this directory was empty. This indicates that there are no verified stable releases for Ubuntu 18.04.
Not to worry, though! The previous versions should work just fine. Alternatively, you can install an edge release by browsing to:
Download the file, and make a note of the path where you saved it. Use the following command:
sudo dpkg -i /path/to/package.deb
Substitute your file location for /path/to/package.deb. Allow the installer to run.
Conclusion
Great job!  You’ve got three (3) different options for installing Docker on Ubuntu 18.04.
Finally, you can check the Docker guides if you get into trouble, plus they have a fairly robust forum you can search. Happy developing!

This is for personal documentation purposes.












Comments

Popular posts from this blog

Reset 120 day RDS Grace period on 2016 and 2019

  Reset 120 day RDS Grace period on 2016 and 2019 Enter the following command to check Grace Period: wmic /namespace:\\root\CIMV2\TerminalServices PATH Win32_TerminalServiceSetting WHERE (__CLASS !=””) CALL GetGracePeriodDays  Confirm-deletion-of-the-timebomb-key-in-the-registry If you have a home lab environment or another lab where you continually test various solutions, licensing, and trial expiration is a challenge that you constantly tend to run into. It is just part of the fun of lab environments. While most trials are fairly “hard and fast” and don’t allow you to reset the trial expiration, if you work with Microsoft Windows Server and Remote Desktop Services (RDS), there is a “hack” that allows you to effectively reset the expiration of  Remote Desktop  Services grace period where you can essentially rewind the clock on your RDS licensing if you are making use of this role inside your lab environment. I am using Windows Server 2019 for my Windows workloads in my lab environment

Remote Desktop Services session timeout Setup in RD Session Host in Windows Servers

  If you face a session time-limit policy issue that gets disconnected in the meantime. You can follow the steps below in order to fix the issue, By default, the user’s RDP session in Windows may stay disconnected until the user or administrator terminates, or the computer is restarted. However, it is quite convenient since a user may connect to his old RDP session and go on working with running programs. In order to terminate disconnected RDP/RDS sessions automatically in a specified time period, you need to set session limits (time-outs) correctly. If you are using an RDS server, you will have to configure session time-out parameters from the RDS collection settings in the Session tab menu. You will have to Specify the time period after which you want to disconnect the RDP session. Lastly, a disconnected session option (by default, a session period is unlimited – Never). Thus, you can set the maximum duration of an active session (Active session limit) and end an idle session (Idle s

Peachtree Auto Backup Using Task Scheduler with images

Before creating an auto backup with Task Scheduler.  1. In PEACHTREE Application, Create an initial Auto Backup. Click Browse to locate folder "SAVE BACKUP TO:" Enter "USERNAME" and "PASSWORD" Follow everything on the image Click "Save As" to your backup folder Then "Run Backup" and copy the PROGRAM SCRIPT  at the bottom to be used later, see image below. Search and open "TASK SCHEDULER" 1. Click the tab "GENERAL" Followup the setup on the picture. 2. Click the tab "TRIGGERS". Then Click the New button to create a schedule. After setting up the schedule. Click OK. 3. To Create new Actions, click the tab "ACTIONS", click NEW then paste the PROGRAM/SCRIPT below. Then Click OK. 4. Next click the tab "CONDITIONS" and follow everything in the picture. 5. Click the tab "SETTING"  and follow everything in the picture.    6. Lastly right-click the folder "TASK SCHEDULER LIBRARY&qu