Olá a todos! No post de hoje iremos realizar a instalação do docker, ferramenta open source utilizada para criar e gerenciar containers no linux.

Como sistema operacional base, iremos utilizar o debian na versão 10 (buster). O docker pode ser instalado através do seu repositório, através de pacotes .deb ou através do script de instalação (recomendado para o caso do raspbian).

Recomendo a instalação através de repositório do docker, pois facilita a atualização de pacotes posteriormente.

Então, vamos lá!

Atualize o repositório de pacotes e instale os pacotes necessários para o APT usar um repositório sobre HTTPS.

# apt-get update
# apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg \
    lsb-release

Adicione a chave GPG oficial do docker:

$ curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

No nosso caso, iremos instalar o repositório em um sistema de arquitetura amd64, então utilize o comando abaixo:

$ echo \
  "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
  $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null

Após esse procedimento atualize novamente a lista de repositórios e em seguida instale os pacotes necessários para o funcionamento do docker:

# apt-get update
# apt-get install docker-ce docker-ce-cli containerd.io

Feito isso seus pacotes estarão instalados e prontos para uso.

Verifique se o Docker está instalado corretamente executando a imagem hello-world.

# docker run hello-world

Caso você queira instalar uma versão específica do Docker, liste as versões disponíveis no repositório, e em seguida selecione e instale:

$ apt-cache madison docker-ce
 docker-ce | 5:20.10.7~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:20.10.6~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:20.10.5~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:20.10.4~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:20.10.3~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:20.10.2~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:20.10.1~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:20.10.0~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:19.03.15~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:19.03.14~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:19.03.13~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:19.03.12~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:19.03.11~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:19.03.10~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:19.03.9~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:19.03.8~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:19.03.7~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:19.03.6~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:19.03.5~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:19.03.4~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:19.03.3~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:19.03.2~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:19.03.1~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:19.03.0~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:18.09.9~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:18.09.8~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:18.09.7~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:18.09.6~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:18.09.5~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:18.09.4~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:18.09.3~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:18.09.2~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:18.09.1~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 5:18.09.0~3-0~debian-buster | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 18.06.3~ce~3-0~debian | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 18.06.2~ce~3-0~debian | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 18.06.1~ce~3-0~debian | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 18.06.0~ce~3-0~debian | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 18.03.1~ce-0~debian | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 18.03.0~ce-0~debian | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 17.12.1~ce-0~debian | https://download.docker.com/linux/debian buster/stable amd64 Packages
 docker-ce | 17.12.0~ce-0~debian | https://download.docker.com/linux/debian buster/stable amd64 Packages
# apt-get install docker-ce=<VERSION_STRING> docker-ce-cli=<VERSION_STRING> containerd.io

Caso queira atualizar o Docker, primeiro atualize a lista de pacotes com o comando “apt-ge update” e, em seguida, siga as instruções de instalação, escolhendo a nova versão que deseja instalar.

Dúvidas, comentários, sugestões?

comments