11/23/2021»»Tuesday

Ubuntu Apt Install Docker

  1. Sudo Apt Install Docker Io Unable To Locate Package
  2. Sudo Apt Install Docker-compose
  3. Sudo Apt Install Docker.io Not Working

This tutorial will show you how to install the latest version of Docker and Docker Compose on Ubuntu 20.04. We’ll also configure the system, so you don’t need to use sudo to run Docker commands.

Note: The steps in this tutorial show you how install Docker manually. Read How to install Docker with Ansible to learn how to automate the process.

  1. For that we are going to use the Ubuntu Package Manager called APT. For that we run the following commands in the command shell: Update the repositories. Sudo apt update. Sudo apt install openjdk-8-jdk. Test that it was correctly done: java -version. The result looks like.
  2. Make sure you are about to install from the Docker repo instead of the default Ubuntu repo: $ apt-cache policy docker-ce. Finally, install Docker: $ sudo apt install docker-ce.
Advertisement

RUN apt-get update && apt-get install -no-install-recommends -yes python3. By doing this, we achieve a decrease of around 60% in our Docker images size. This obviously will vary according to the dependencies you are using. In our case, we did it for all our Python websites which reduced the size of all our Docker containers significantly. In this section, we will show you how to install Docker on Ubuntu from Docker official repository. Apt-get install docker-ce=5:19.03.113-0ubuntu-focal Step 6. The following instructions will install Docker Engine on one of these supported Ubuntu and Debian releases: Supported distributions: Ubuntu 20.04, Ubuntu 18.04, Ubuntu 16.04, Debian 10, Debian 9. Recent non-LTS releases like Ubuntu 21.04 and 20.10 should also be supported.

Prerequisites

Before we begin you’ll need access to a clean installation of Ubuntu 20.04. This tutorial shows you how to install it on VMware Fusion (or VMware Workstation if you’re a Windows or Linux user).

You may also want to update your packages to the latest versions by running:

Advertisement

Step 1: Install Dependencies

Run the following command to install the required dependencies.

Step 2: Add Docker Signing Key

Verify the key is correct by running the following command and checking the output matches 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88:

Advertisement

Step 3: Add Docker Stable Repository

Run the following command to add the stable Docker repository to /etc/apt/sources.list

Update package information:

Step 4: Install Docker

Run the following command to install Docker:

Advertisement

Step 5: Add User to Docker group

The last step is to add your local user to the docker group so that you don’t need to use sudo when running Docker commands. Run the following command to add it to the group:

Sign out then back in for the changes to take effect. You should now be able to run an image without using sudo. You can test this by running the hello-world image:

Advertisement

Installing Docker Compose

Docker Compose can be installed with apt by running:

However, using apt will not install the latest version. You can install the latest with curl by running the following commands:

Note: replace 1.27.4 in the URL above with the version you want to install.

Conclusion

In this tutorial we installed the latest version of Docker and Docker Compose on Ubuntu Linux 20.04.

These steps are good for one time installations, but if you’ve got hundreds of servers to configure, you might want to automate this process. This tutorial will show you how to automate the installation of Docker with Ansible.

Written by Tony Mackay

Ubuntu apt install docker software

Software developer, sysadmin and writer. Find me here: https://tonymackay.net

This tutorial will show you how to install the latest version of Docker and Docker Compose on Ubuntu 20.04. We’ll also configure the system, so you don’t need to use sudo to run Docker commands.

Note: The steps in this tutorial show you how install Docker manually. Read How to install Docker with Ansible to learn how to automate the process.

Advertisement

Prerequisites

Before we begin you’ll need access to a clean installation of Ubuntu 20.04. This tutorial shows you how to install it on VMware Fusion (or VMware Workstation if you’re a Windows or Linux user).

You may also want to update your packages to the latest versions by running:

Advertisement

Sudo Apt Install Docker Io Unable To Locate Package

Step 1: Install Dependencies

Run the following command to install the required dependencies.

Step 2: Add Docker Signing Key

Verify the key is correct by running the following command and checking the output matches 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88:

Advertisement

Step 3: Add Docker Stable Repository

Run the following command to add the stable Docker repository to /etc/apt/sources.list

Update package information:

Step 4: Install Docker

Run the following command to install Docker:

Advertisement

Step 5: Add User to Docker group

The last step is to add your local user to the docker group so that you don’t need to use sudo when running Docker commands. Run the following command to add it to the group:

Sign out then back in for the changes to take effect. You should now be able to run an image without using sudo. You can test this by running the hello-world image:

Advertisement

Sudo Apt Install Docker-compose

Ubuntu apt install docker windows 10

Installing Docker Compose

Docker Compose can be installed with apt by running:

MacUbuntu apt install docker download

Sudo Apt Install Docker.io Not Working

However, using apt will not install the latest version. You can install the latest with curl by running the following commands:

Note: replace 1.27.4 in the URL above with the version you want to install.

Conclusion

In this tutorial we installed the latest version of Docker and Docker Compose on Ubuntu Linux 20.04.

These steps are good for one time installations, but if you’ve got hundreds of servers to configure, you might want to automate this process. This tutorial will show you how to automate the installation of Docker with Ansible.

Written by Tony Mackay

Ubuntu Apt Install Docker

Software developer, sysadmin and writer. Find me here: https://tonymackay.net

Most Viewed Posts