User Tools

Site Tools


install_debian_docker

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

install_debian_docker [2025/07/26 17:09] – - Imported by DokuWiki Advanced Plugin wikiadminstall_debian_docker [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1
Line 1: Line 1:
-====== Instalação do Docker no Debian 11 ====== 
-Preparação inicial: [[initial_config_deb|Configuração inicial - Debian]] 
  
-===== Partição deservada aos containers ===== 
-<file bash> 
-$ MOUNT_POINT=/var/lib/docker 
-$ DISK_DEVICE=/dev/sdb 
-</file> 
- 
-<file bash> 
-$ echo -e "n\np\n1\n\n\nw" | sudo fdisk ${DISK_DEVICE} 
- 
-Bem-vindo ao fdisk (util-linux 2.36.1). 
-As alterações permanecerão apenas na memória, até que você decida gravá-las. 
-Tenha cuidado antes de usar o comando de gravação. 
- 
-A unidade não contém uma tabela de partição conhecida. 
-Criado um novo rótulo de disco DOS com o identificador de disco 0x0125a9ba. 
- 
-Comando (m para ajuda): Tipo da partição 
-     primária (0 primárias, 0 estendidas, 4 livre) 
-     estendida (recipiente para partições lógicas) 
-Selecione (padrão p): Número da partição (1-4, padrão 1): Primeiro setor (2048-134217727, padrão 2048): Último setor, +/-setores ou +/-tamanho{K,M,G,T,P} (2048-134217727, padrão 134217727): 
-Criada uma nova partição 1 do tipo "Linux" e de tamanho 64 GiB. 
- 
-Comando (m para ajuda): A tabela de partição foi alterada. 
-Chamando ioctl() para reler tabela de partição. 
-Sincronizando discos. 
-</file> 
- 
-<file bash> 
-$ sudo mkfs.ext4 ${DISK_DEVICE}1 
-mke2fs 1.46.2 (28-Feb-2021) 
-Creating filesystem with 16776960 4k blocks and 4194304 inodes 
-Filesystem UUID: fa0fb33c-fec6-40c9-ae70-6babebbe5b6e 
-Superblock backups stored on blocks: 
-        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
-        4096000, 7962624, 11239424 
- 
-Allocating group tables: done 
-Writing inode tables: done 
-Creating journal (65536 blocks): done 
-Writing superblocks and filesystem accounting information: done 
-</file> 
- 
-<file bash> 
-$ UUID=`sudo blkid -o export ${DISK_DEVICE}1 | grep UUID | grep -v PARTUUID` 
-$ sudo mkdir ${MOUNT_POINT} 
-$ sudo cp -p /etc/fstab{,.dist} 
-</file> 
- 
-<file bash> 
-$ echo "${UUID}  ${MOUNT_POINT}    ext4    defaults 1 2" | sudo tee -a /etc/fstab 
-UUID=fa0fb33c-fec6-40c9-ae70-6babebbe5b6e  /var/lib/docker    ext4    defaults 1 2 
-</file> 
- 
-<file bash> 
-$ sudo mount ${MOUNT_POINT} 
-</file> 
- 
-<file bash> 
-$ df -hT | grep docker 
-/dev/sdb1      ext4       63G   24K   60G   1% /var/lib/docker 
-</file> 
- 
-===== Adicionando o repositório do Docker ===== 
-<file bash> 
-$ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - 
-Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)). 
-OK 
-</file> 
- 
-<file bash> 
-$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" 
-</file> 
- 
-===== Instalação o Docker ===== 
- 
-<file bash> 
-$ sudo apt update 
-</file> 
- 
-<file bash> 
-$  apt-cache policy docker-ce 
-docker-ce: 
-  Instalado: (nenhum) 
-  Candidato: 5:20.10.16~3-0~debian-bullseye 
-  Tabela de versão: 
-     5:20.10.16~3-0~debian-bullseye 500 
-        500 https://download.docker.com/linux/debian bullseye/stable amd64 Packages 
-     5:20.10.15~3-0~debian-bullseye 500 
-        500 https://download.docker.com/linux/debian bullseye/stable amd64 Packages 
-     5:20.10.14~3-0~debian-bullseye 500 
-        500 https://download.docker.com/linux/debian bullseye/stable amd64 Packages 
-     5:20.10.13~3-0~debian-bullseye 500 
-        500 https://download.docker.com/linux/debian bullseye/stable amd64 Packages 
-     5:20.10.12~3-0~debian-bullseye 500 
-        500 https://download.docker.com/linux/debian bullseye/stable amd64 Packages 
-     5:20.10.11~3-0~debian-bullseye 500 
-        500 https://download.docker.com/linux/debian bullseye/stable amd64 Packages 
-     5:20.10.10~3-0~debian-bullseye 500 
-        500 https://download.docker.com/linux/debian bullseye/stable amd64 Packages 
-     5:20.10.9~3-0~debian-bullseye 500 
-        500 https://download.docker.com/linux/debian bullseye/stable amd64 Packages 
-     5:20.10.8~3-0~debian-bullseye 500 
-        500 https://download.docker.com/linux/debian bullseye/stable amd64 Packages 
-     5:20.10.7~3-0~debian-bullseye 500 
-        500 https://download.docker.com/linux/debian bullseye/stable amd64 Packages 
-     5:20.10.6~3-0~debian-bullseye 500 
-        500 https://download.docker.com/linux/debian bullseye/stable amd64 Packages 
-</file> 
- 
-<file bash> 
-$ sudo apt install docker-ce 
-</file> 
- 
-<file bash> 
-$ dpkg -l | egrep "docker|container" 
-ii  containerd.io                  1.6.4-1                        amd64        An open and reliable container runtime 
-ii  docker-ce                      5:20.10.16~3-0~debian-bullseye amd64        Docker: the open-source application container engine 
-ii  docker-ce-cli                  5:20.10.16~3-0~debian-bullseye amd64        Docker CLI: the open-source application container engine 
-ii  docker-ce-rootless-extras      5:20.10.16~3-0~debian-bullseye amd64        Rootless support for Docker. 
-ii  docker-scan-plugin             0.17.0~debian-bullseye         amd64        Docker scan cli plugin. 
-</file> 
- 
-<file bash> 
-$ sudo docker version 
-Client: Docker Engine - Community 
- Version:           20.10.16 
- API version:       1.41 
- Go version:        go1.17.10 
- Git commit:        aa7e414 
- Built:             Thu May 12 09:17:39 2022 
- OS/Arch:           linux/amd64 
- Context:           default 
- Experimental:      true 
- 
-Server: Docker Engine - Community 
- Engine: 
-  Version:          20.10.16 
-  API version:      1.41 (minimum version 1.12) 
-  Go version:       go1.17.10 
-  Git commit:       f756502 
-  Built:            Thu May 12 09:15:42 2022 
-  OS/Arch:          linux/amd64 
-  Experimental:     false 
- containerd: 
-  Version:          1.6.4 
-  GitCommit:        212e8b6fa2f44b9c21b2798135fc6fb7c53efc16 
- runc: 
-  Version:          1.1.1 
-  GitCommit:        v1.1.1-0-g52de29d 
- docker-init: 
-  Version:          0.19.0 
-  GitCommit:        de40ad0 
-</file> 
- 
-===== Adicinando o usuário ao grupo docker ===== 
- 
-<file bash> 
-$ sudo usermod -aG docker ${USER} 
-</file> 
- 
-<file bash> 
-$ getent group | grep docker 
-docker:x:997:suporte 
-</file> 
- 
-===== Alterando a rede padrão do docker e habilitando o IPv6 ===== 
-<file json daemon.json> 
-$ cat /etc/docker/daemon.json  
-{ 
-  "ipv6": true, 
-  "ip6tables": true, 
-  "experimental": true, 
-  "fixed-cidr-v6": "fd00::/64", 
-  "default-address-pools":[ 
-          {"base": "192.168.0.0/16", "size": 24}, 
-          {"base": "fd00::/56", "size": 64} 
-  ] 
-} 
- 
-</file> 
- 
-<file bash> 
-$ sudo systemctl restart docker 
-</file> 
- 
-<file bash> 
-$ ip -br a s docker0 
-docker0          DOWN           10.254.0.1/26 fd00:0:0:100::1/64 fe80::1/64 
-</file> 
- 
-<code bash> 
-$ docker network create --subnet="192.168.01.0/24" --gateway="192.168.1.1" --subnet="fd00:0:0:1::/64" --gateway="fd00:0:0:1::1" --ipv6 zbx-network 
-</code> 
install_debian_docker.1753560543.txt.gz · Last modified: by wikiadm