Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

[Dúvida] Erro ao usar o docker-compose build

Ao usar o comando, apareceu a seguinte mensagem....

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 699, in urlopen httplib_response = self.makerequest( File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 394, in makerequest conn.request(method, url, **httplib_request_kw) File "/usr/lib/python3.10/http/client.py", line 1282, in request self.sendrequest(method, url, body, headers, encode_chunked) File "/usr/lib/python3.10/http/client.py", line 1328, in sendrequest self.endheaders(body, encode_chunked=encode_chunked) File "/usr/lib/python3.10/http/client.py", line 1277, in endheaders self.sendoutput(message_body, encode_chunked=encode_chunked) File "/usr/lib/python3.10/http/client.py", line 1037, in sendoutput self.send(msg) File "/usr/lib/python3.10/http/client.py", line 975, 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

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/requests/adapters.py", line 439, in send resp = conn.urlopen( File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 755, in urlopen retries = retries.increment( File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 532, in increment raise six.reraise(type(error), error, stacktrace) File "/usr/lib/python3/dist-packages/six.py", line 718, in reraise raise value.withtraceback(tb) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 699, in urlopen httplib_response = self.makerequest( File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 394, in makerequest conn.request(method, url, **httplib_request_kw) File "/usr/lib/python3.10/http/client.py", line 1282, in request self.sendrequest(method, url, body, headers, encode_chunked) File "/usr/lib/python3.10/http/client.py", line 1328, in sendrequest self.endheaders(body, encode_chunked=encode_chunked) File "/usr/lib/python3.10/http/client.py", line 1277, in endheaders self.sendoutput(message_body, encode_chunked=encode_chunked) File "/usr/lib/python3.10/http/client.py", line 1037, in sendoutput self.send(msg) File "/usr/lib/python3.10/http/client.py", line 975, in send self.connect() File "/usr/lib/python3/dist-packages/docker/transport/unixconn.py", line 30, in connect sock.connect(self.unix_socket) urllib3.exceptions.ProtocolError: ('Connection aborted.', PermissionError(13, 'Permission denied'))

During handling of the above exception, another exception occurred:

... (continua, mas como a msg de erro eh muito grande, parei por aqui).

Detalhes:

Docker version 20.10.12, build 20.10.12-0ubuntu4

docker-compose version 1.29.2, build unknown

S.O.: Linux Mint 21 Cinamon

Alguma ideia de como resolver? Grato

2 respostas

Consegui fazer rodar o comando, fazendo da seguinte forma: sudo docker-compose build. Esse problema, eu consegui resolver, mas apareceram outros:

Vamos a eles:

Collecting Django==3.2.10 Downloading Django-3.2.10-py3-none-any.whl (7.9 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.9/7.9 MB 30.5 kB/s eta 0:00:00 WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after conection broken by 'ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))': /simple/django-cors-headers/

Aparece esse warning e depois continua prosseguindo para a linha abaixo.

Collecting django-cors-headers==3.10.1

Downloading django_cors_headers-3.10.1-py3-none-any.whl (12 kB)

... (continua)

Ja quase no final, apareceu isso:

Collecting packaging==21.3 Downloading packaging-21.3-py3-none-any.whl (40 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 40.8/40.8 kB 36.2 kB/s eta 0:00:00 ERROR: Ignored the following versions that require a different python version: 4.4.0 Requires-Python >=3.6,<3.9 ERROR: Could not find a version that satisfies the requirement Pillow==8.4.0 (from versions: none) ERROR: No matching distribution found for Pillow==8.4.0

[notice] A new release of pip available: 22.3.1 -> 23.0.1 [notice] To update, run: pip install --upgrade pip The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 1 ERROR: Service 'web' failed to build : Build failed

E agora? Alguma sugestao?

solução!

Depois de varias tentativas, consegui instalar o Docker a partir da pagina de documentacao oficial, "Install from a package". Gostaria de deixar tres dicas, pra quem seguir esse caminho: (Eu baixei os pacotes mais recentes)

1 - Depois de baixado os pacotes, na hora da instalacao a ordem que eu segui foi:

    sudo dpkg -i ./containerd.io_<version>_<arch>.deb \
    ./docker-ce-cli_<version>_<arch>.deb \  (esse primeiro... no site, ele vem depois do docker-ce)
    ./docker-ce_<version>_<arch>.deb \
    ./docker-buildx-plugin_<version>_<arch>.deb \
    ./docker-compose-plugin_<version>_<arch>.deb

Eu instalei linha por linha e nao copiei e colei como tem no site.

2 - Configure para que seu usuario possa executar o Docker, senao, ele so vai executar se for root. Verifique se foi criado o grupo docker e adicione seu usuario a esse grupo, com o comando:

sudo usermod -aG docker $USER

3 - Na hora de voce executar o build, execute o comando assim: docker compose build (nao tem hifen na versao mais atualizada). Da mesma forma na versao no comando UP: docker compose up.

O meu ta funcionando de boa! Penei um bocadinho, mas acabou dando certo! kkkkk Espero que essas dicas possam ajudar alguem.