Instalando Docker CE no CentOS 8 / RHEL 8

Olá amigos, tudo certo?

Estou sumido a quase 7 meses depois de iniciar em meu novo emprego em um Datacenter 🙂

Vamos falar um pouco sobre Container e como instalar o Docker CE no CentOS 8 e RHEL 8 .

Oque na minha opinião foi um erro é que nas ultimas versões de ambas distribuições o pacote do docker foi removido de seus repositórios padrão. Detalhe, foi trocado pelo podam e buildah.

O Docker está disponível em duas versões.

  • Docker CE (Community Edition)
  • Enterprise Edition (EE)

Requisitos de sistema para o Docker CE

  • CentOS minimo 8 / RHEL 8
  • Privilegios sudo ou root
  • Conexao com internet

Vamos iniciar o processo de instalação.

Etapa 1: Habilitar o Repositório do Docker CE

Execute o comando dnf para ativar o repositório de pacotes Docker CE.

dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo

Etapa 2: Instalar Docker CE com comando DNF

Depois que o repositório do Docker CE tiver sido configurado com êxito, execute o seguinte comando para verificar qual versão do docker está disponível para instalação:

dnf list docker-ce

Agora, use o comando abaixo dnf para instalar a versão mais recente do docker:

dnf install docker-ce --nobest -y

Após a instalação do docker, inicie e ative seu serviço usando os seguintes comandos systemctl:

systemctl start docker
systemctl enable docker

Execute o comando abaixo para verificar a versão do docker instalado:

docker --version

Sucesso amigos, assim vocês já estão com o Docker instalado em um servidor para começar a brincar com o Docker.

Nos próximos posts devemos ver como criar um cluster com Swarm.

Qualquer duvida só avisar.

Continue Reading

How To Install Docker on Centos 7 and Red Hat 7

Hello friends, I’m starting some posts referring to a Docker.
During the next months, we will make an update more frequent, all of us who have a suggestion please send an email to: geraldo@techpoli.info.

Introduction:

Docker is a software technology providing containers, promoted by the company Docker, Inc. Docker provides an additional layer of abstraction and automation of operating-system-level virtualization on Windows and Linux. Docker uses the resource isolation features of the Linux kernel such as cgroups and kernel namespaces, and a union-capable file system such as OverlayFS and others to allow independent “containers” to run within a single Linux instance, avoiding the overhead of starting and maintaining virtual machines.

The Linux kernel’s support for namespaces mostly isolates an application’s view of the operating environment, including process trees, network, user IDs and mounted file systems, while the kernel’s cgroups provide resource limiting, including the CPU, memory, block I/O, and network. Since version 0.9, Docker includes the libcontainer library as its own way to directly use virtualization facilities provided by the Linux kernel, in addition to using abstracted virtualization interfaces via libvirt, LXC (Linux Containers) and systemd-nspawn.

Step 1: Installation of Docker

As a matter of best practice we’ll update our packages:

yum -y update

Now run this command. It will add the official Docker repository, download the latest version of Docker and install it:

curl -fsSL https://get.docker.com/ | sh

Step 2: Start the docker and configure to start with the operating system.

Set the Docker service to start at boot:

systemctl enable docker

Then start the Docker service:

systemctl start docker

And verify your work by checking the status of Docker:

systemctl status docker

Step 3: Download Container

Download the centos Docker image:

Note you can choose any system like Ubuntu or Debian.

docker pull centos

Step 4: Run Container

As an example, let’s run a container using the latest image of CentOS. The combination of the -i and -t switches gives you interactive shell access into the container:

docker run -i -t centos /bin/bash

You are now using a docking dock inside a docker centos.

To disconnect or detach from the shell without exiting, use a string of Ctrl + Ctrl-p + Ctrl-q.

There are many community containers already available that can be found through a survey. On the command below, I look for a Ubuntu keyword:

docker search ubuntu:17.04

Friends, that’s all.
We will continue with more advanced articles on docker.

Continue Reading