Instalação do Docker CE no CentOS 8

OBJETIVOS

  1. Preparar o CentOS 8;
  2. Instalar o Docker CE;
  3. Instalar o Docker Compose;
  4. Testes.

REQUISITOS

  1. Esta implementação requer um servidor GNU/Linux CentOS 8 e selecionada a opção minimal install, o hardware sugerido é:
    1. 2 vCPU;
    2. 2 GB RAM;
    3. 20 GB disco SSD;
    4. Rede com acesso a Internet;

PROCEDIMENTO

A seguir o procedimento para realizar a implementação.

PREPARAR O CENTOS 8

vi /etc/hostname

centos8.local

vi /etc/sysconfig/network-scripts/ifcfg-eth0

TYPE=”Ethernet”

PROXY_METHOD=”none”

BROWSER_ONLY=”no”

BOOTPROTO=”none”

DEFROUTE=”yes”

IPV4_FAILURE_FATAL=”no”

IPV6INIT=”no”

IPV6_AUTOCONF=”yes”

IPV6_DEFROUTE=”yes”

IPV6_FAILURE_FATAL=”no”

IPV6_ADDR_GEN_MODE=”stable-privacy”

NAME=”eth0″

# UUID=””

DEVICE=”eth0″

ONBOOT=”yes”

IPADDR=”10.0.0.210″

PREFIX=”24″

GATEWAY=”10.0.0.1″

DNS1=”10.0.0.12″

DNS2=”10.0.0.13″

DOMAIN=”local”

IPV6_PRIVACY=”no”

ifup eth0

dnf update

sed -i s/SELINUX=enforcing/SELINUX=permissive/g /etc/selinux/config

setenforce 0

systemctl disable –now firewalld

INSTALAR O DOCKER CE

dnf install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm

curl -sSL https://get.docker.com | bash

systemctl enable –now docker

dnf clean all

docker -v

Docker version 19.03.3, build a872fc2f86

INSTALAÇÃO DO DOCKER COMPOSE

curl -k -SL “https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)” -o /usr/local/bin/docker-compose

chmod +x /usr/local/bin/docker-compose

docker-compose -v

docker-compose version 1.24.1, build 4667896b

TESTES

docker run –rm -it hello-world

REFERÊNCIAS

https://hub.docker.com/
https://docs.docker.com/get-started/