Docker Repository Debian

2/12/2022by admin
  • Jul 30, 2019 Install Docker on Debian#. Perform the following steps to install the latest stable Docker version from the Docker’s repositories. Install the packages necessary to add a new repository over HTTPS: sudo apt update sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg2.
  • So, let’s install it on Debian 11. Install Docker on Debian 11. From the official Docker documentation, we are told that there are several methods of installation. One of them is to add the official Docker repository to the system to get the latest stable version available. This is the recommended method.
Docker Repository Debian

See Full List On Hub.docker.com

No matter your distribution of choice, you’ll need a 64-bit installation and a kernel at 3.10 or newer. Kernels older than 3.10 do not have the necessary features Docker requires to run containers; data loss and kernel panics occur frequently under certain conditions.

Docker.io Debian Repository

Check your current Linux version with uname -r. You should see something like 3.10.[alphanumeric string].x86_64.

Install Docker Engine. This procedure works for Debian on x8664 / amd64, armhf, arm64, and Raspbian. Update the apt package index, and install the latest version of Docker Engine and containerd, or go to the next step to install a specific version: $ sudo apt-get update $ sudo apt-get install docker-ce docker-ce-cli containerd.io.

Debian and Ubuntu

Docker repository debian command

Docker runs on:

  • Ubuntu Xenial 16.04 LTS
  • Ubuntu Wily 15.10
  • Ubuntu Trusty 14.04 LTS
  • Ubuntu Precise 12.04 LTS
  • Debian testing stretch
  • Debian 8.0 Jessie
  • Debian 7.0 Wheezy (you must enable backports)

Debian Wheezy

If so, you need to enable backports (if not, ignore this section):

  1. Log into the system and open a terminal with sudo or root privileges (or run sudo -i from your terminal).
  2. Open /etc/apt/sources.list.d/backports.list with your favorite text editor (if the file does not exist, create it).
  3. Remove existing entries.
  4. Add an entry for backports on Debian Wheezy:
  5. Update your packages:

Ubuntu Precise 12.04

If so, you need to make sure you have the 3.13 kernel version. You must upgrade your kernel:

  1. Open a terminal on your system.
  2. Update aptitude:
  3. Install the additional packages:
  4. On a graphical Ubuntu environment, you need to additionally run the following:
  5. Reboot your system:

Update Aptitude

  1. Log onto your system with a user with sudo privileges.
  2. Open a terminal window.
  3. Purge the older repositories:
  4. Update your packages, making sure apt works with https and the server has CA certificates:
  5. Get the new GPG key:
  6. Open or create the file /etc/apt/sources.list.d/docker.list in your favorite text editor (you need sudo or root for this).
  7. Add an entry for your OS

    VersionSource
    Ubuntu Precise 12.04 LTSdeb https://apt.dockerproject.org/repo ubuntu-precise main
    Ubuntu Trusty 14.04 LTSdeb https://apt.dockerproject.org/repo ubuntu-trusty main
    Ubuntu Wily 15.10 LTSdeb https://apt.dockerproject.org/repo ubuntu-wily main
    Ubuntu Xenial 16.04 LTSdeb https://apt.dockerproject.org/repo ubuntu-xenial main
    Debian Wheezydeb https://apt.dockerproject.org/repo debian-wheezy main
    Debian Jessiedeb https://apt.dockerproject.org/repo debian-jessie main
    Debian Stretch/Siddeb https://apt.dockerproject.org/repo debian-stretch main
  8. Save and close the file.
  9. Update Aptitude again:
  10. Verify Aptitude pulls from the right repository:

Install Docker

If you use Ubuntu Trusty, Wily, or Xenial, install the linux-image-extra kernel package:

  1. Install Docker:
  2. Start Docker:
  3. Verify Docker:

The Docker Group

If you prefer, you can set up a docker group to run Docker (instead of root). However, as docker must have sudo access, docker receives the same access as root.

  1. Run the following command to create a Docker group on Ubuntu:
  2. Log out and back in.

  3. Run the following command to create a Docker group on Debian:

    You may specify a user instead of ${USER} if you prefer.

  4. Verify a successful Docker installation:

Red Hat Enterprise Linux (RHEL) and CentOS

Docker runs on RHEL 7 and CentOS 7.

Install Docker

Install with Yum

  1. Log into your system as a user with sudo privileges.
  2. Update your system: sudo yum update -y.
  3. Add the yum repo (use the code below for both RHEL 7 and CentOS 7):
  4. Install Docker:
  5. Start Docker:
  6. Verify Docker:

Install with the Docker Installation Script

  1. Log into your system as a user with sudo privileges.
  2. Update your system:
  3. Run Docker’s installation script:

    This script adds the docker.repo repository and installs Docker.

  4. Start Docker:
  5. Verify Docker:

The Docker Group

If you prefer, you can set up a docker group to run Docker (instead of root). However, as docker must have sudo access, docker receives the same access as root.

  1. Run the following command to create a Docker group and add your user to the group (replace USERNAME with your username):
  2. Log out and back in.
  3. Verify Docker works without sudo:

Start Docker at Boot

Run one of the following:

Repository
  • sudo chkconfig docker on
  • sudo systemctl enable docker

Common Issues

Note: Members in the docker group have root privileges. Hardening Docker is covered in a future tutorial.

Ubuntu

Ubuntu Utopic 14.10 and 15.05 exist in Docker’s apt repository without official support. Upgrade to 15.10 or [preferably] 16.04. If you use Ubuntu 12.04, you need to update your kernel.

Debian

If you run Debian Wheezy, you need to update the sources with backports.

“Cannot connect to the Docker daemon. Is ‘docker daemon’ running on this host?”

RepositoryRepository

If you get this error, you need to unset DOCKER_HOST; run unset DOCKER_HOST to clear the variable.

Next: Using Docker Hub
All about how to use Docker's hosted registry.

Comments are closed.