Instalei o kubuntu 22.04 novo em meu laptop e quando tento instalar o docker, instalei docker-ce e docker-compose :
root@serge-at-home:/mnt/_work_sdb8/wwwroot/lar/MngProducts# dpkg -s docker-compose
Package: docker-compose
Status: install ok installed
Priority: optional
Section: admin
Installed-Size: 498
Maintainer: Ubuntu Developers <[email protected]>
Architecture: all
Version: 1.29.2-1
Depends: python3-cached-property (>= 1.2.0) | python3 (>> 3.8), python3-distro (>= 1.5.0), python3-docker (>= 5), python3-dockerpty (>= 0.4.1), python3-docopt (>= 0.6.1), python3-dotenv (>= 0.13.0), python3-jsonschema, python3-requests (>= 2.20.0), python3-texttable (>= 0.9.0), python3-websocket (>= 0.32.0), python3-yaml (>= 3.10), python3:any, python3-distutils
Recommends: docker.io (>= 1.9.0)
Description: define and run multi-container Docker applications with YAML
docker-compose is a service management software built on top of docker. Define
your services and their relationships in a simple YAML file, and let compose
handle the rest.
Original-Maintainer: Docker Compose Team <[email protected]>
Homepage: https://docs.docker.com/compose/
root@serge-at-home:/mnt/_work_sdb8/wwwroot/lar/MngProducts# dpkg -s docker-ce
Package: docker-ce
Status: install ok installed
Priority: optional
Section: admin
Installed-Size: 94347
Maintainer: Docker <[email protected]>
Architecture: amd64
Version: 5:24.0.6-1~ubuntu.22.04~jammy
Replaces: docker-engine
Depends: containerd.io (>= 1.6.4), docker-ce-cli, iptables, libseccomp2 (>= 2.3.0), libc6 (>= 2.34), libdevmapper1.02.1 (>= 2:1.02.97), libsystemd0
Recommends: apparmor, ca-certificates, docker-ce-rootless-extras, git, libltdl7, pigz, procps, xz-utils
Suggests: aufs-tools, cgroupfs-mount | cgroup-lite
Conflicts: docker (<< 1.5~), docker-engine, docker-engine-cs, docker.io, lxc-docker, lxc-docker-virtual-package
Conffiles:
/etc/default/docker 01f06689327cb8ded58332709d28670c
/etc/init.d/docker 4cd80dac70f6019cb5a9c36c38f2e8d2
Description: Docker: the open-source application container engine
Docker is a product for you to build, ship and run any application as a
lightweight container
.
Docker containers are both hardware-agnostic and platform-agnostic. This means
they can run anywhere, from your laptop to the largest cloud compute instance and
everything in between - and they don't require you to use a particular
language, framework or packaging system. That makes them great building blocks
for deploying and scaling web apps, databases, and backend services without
depending on a particular stack or provider.
Homepage: https://www.docker.com
root@serge-at-home:/mnt/_work_sdb8/wwwroot/lar/MngProducts# uname -a
Linux serge-at-home 6.2.0-34-generic #34~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep 7 13:12:03 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Eu executei o comando:
sudo chmod +x /usr/bin/docker-compose
sem erros.
Mas executando o docker no meu projeto, recebi o erro "Permissão negada" de qualquer maneira
serge@serge-at-home:/_wwwroot/lar/FilamentBanners/__DOCKER$ docker-compose up -d --build
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 394, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib/python3.10/http/client.py", line 1283, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.10/http/client.py", line 1329, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.10/http/client.py", line 1278, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.10/http/client.py", line 1038, in _send_output
self.send(msg)
File "/usr/lib/python3.10/http/client.py", line 976, in send
self.connect()
File "/usr/lib/python3/dist-packages/docker/transport/unixconn.py", line 30, in connect
sock.connect(self.unix_socket)
PermissionError: [Errno 13] Permission denied
também executo comandos:
usermod -aG docker $USER
e
newgrp - docke
Mas mesmo assim o mesmo erro... O que perdi durante a instalação?
Você está executando o antigo Docker Compose (
docker-compose
), que não é mais desenvolvido (e também não está mais incluído nos repositórios do Docker).Eu recomendaria mudar para o novo plugin Docker Compose V2 (
docker compose
), em vez de solucionar problemas de software não suportado.Primeiro remova o pacote antigo: (dos repositórios do Ubuntu, não correspondendo à sua versão do Docker)
Agora instale a nova versão: (dos repositórios Docker)
De agora em diante, em vez de usar
docker-compose
, usedocker compose
- veja também aqui para criar um alias.