CentOS 7:
Установим необходимые утилиты:
1 2 | yum install -y yum-utils \ device-mapper-persistent-data lvm2 |
Добавим репозиторий докера, чтобы установить актуальную версию:
1 2 | yum-config-manager --add-repo \ https: //download .docker.com /linux/centos/docker-ce .repo |
Установим Docker:
1 | yum install -y docker-ce |
Ubuntu:
Обновим список пакетов и установим необходимые:
1 | apt update |
1 2 3 4 5 | apt install -y \ apt-transport-https \ ca-certificates \ curl \ software-properties-common |
Добавим ключ репозитория:
1 | curl -fsSL https: //download .docker.com /linux/ubuntu/gpg | apt-key add - |
Добавляем сам репозиторий и еще раз перечитываем список пакетов:
1 2 3 4 | add-apt-repository \ "deb [arch=amd64] https: //download .docker.com /linux/ubuntu \ $(lsb_release -cs) \ stable" |
1 | apt update |
Установка Docker:
1 | apt install -y docker-ce |
P.S. Docker Engine является устаревшим, необходимо устанавливать CE.