2

I'm, trying to create image by sudo docker-compose build but docker cab't install requirements.txt. Here is result:

(dmoj2) tien@tien-Inspiron-3543:~/bkdn-oj-docker/dmoj$ sudo docker-compose build
[sudo] password for tien: 
db uses an image, skipping
redis uses an image, skipping
nginx uses an image, skipping
Building texoid
[+] Building 4.1s (9/9) FINISHED                                                                       
 => [internal] load build definition from Dockerfile                                              0.1s
 => => transferring dockerfile: 614B                                                              0.0s
 => [internal] load .dockerignore                                                                 0.0s
 => => transferring context: 2B                                                                   0.0s
 => [internal] load metadata for docker.io/library/debian:buster-slim                             4.0s
 => [1/5] FROM docker.io/library/debian:buster-slim@sha256:eecda7f7a3e9cd93d7748c7643628e3a95d62  0.0s
 => CACHED [2/5] RUN apt-get update &&     apt-get install -y --no-install-recommends         te  0.0s
 => CACHED [3/5] RUN git clone https://github.com/DMOJ/texoid/                                    0.0s
 => CACHED [4/5] WORKDIR /texoid/                                                                 0.0s
 => CACHED [5/5] RUN pip3 install -e .                                                            0.0s
 => exporting to image                                                                            0.0s
 => => exporting layers                                                                           0.0s
 => => writing image sha256:8686860cafbdaad8f982387e9cc3d6103fe68c59497db3f3afdea3e8a9ed097c      0.0s
 => => naming to docker.io/ninjaclasher/dmoj-texoid                                               0.0s
Building mathoid
[+] Building 2.4s (7/7) FINISHED                                                                       
 => [internal] load build definition from Dockerfile                                              0.0s
 => => transferring dockerfile: 229B                                                              0.0s
 => [internal] load .dockerignore                                                                 0.0s
 => => transferring context: 2B                                                                   0.0s
 => [internal] load metadata for docker.io/library/node:10.21.0                                   2.4s
 => [1/3] FROM docker.io/library/node:10.21.0@sha256:f9e66964ec6e9a78693929b58b3d95aadf03cc70e47  0.0s
 => CACHED [2/3] RUN npm install mathoid &&     ln -sfv /node_modules/mathoid/app.js /node_modul  0.0s
 => CACHED [3/3] WORKDIR /node_modules/mathoid                                                    0.0s
 => exporting to image                                                                            0.0s
 => => exporting layers                                                                           0.0s
 => => writing image sha256:2c947dd6572b119b2fc94775ee168f9ebbe98645eed24cf9ec8576bb5074c604      0.0s
 => => naming to docker.io/ninjaclasher/dmoj-mathoid                                              0.0s
Building base
[+] Building 135.3s (11/11) FINISHED                                                                   
 => [internal] load build definition from Dockerfile                                              0.0s
 => => transferring dockerfile: 1.43kB                                                            0.0s
 => [internal] load .dockerignore                                                                 0.0s
 => => transferring context: 2B                                                                   0.0s
 => [internal] load metadata for docker.io/library/python:3.8-slim-buster                         2.6s
 => [internal] load build context                                                                 0.0s
 => => transferring context: 67B                                                                  0.0s
 => [1/7] FROM docker.io/library/python:3.8-slim-buster@sha256:f51af6b4116b1c3a5a7934070b0761d1d  0.0s
 => CACHED [2/7] RUN apt-get update &&     apt-get install -y         git gcc g++ make curl gett  0.0s
 => CACHED [3/7] RUN npm install -g sass postcss-cli postcss autoprefixer                         0.0s
 => CACHED [4/7] RUN pip3 install         pymysql mysqlclient websocket-client uwsgi django-redi  0.0s
 => CACHED [5/7] RUN apt-get update &&     apt-get install -y unzip xvfb libxi6 libgconf-2-4 &&   0.0s
 => CACHED [6/7] COPY repo/requirements.txt .                                                     0.0s
 => ERROR [7/7] RUN pip3 install -r requirements.txt                                            132.7s
------                                                                                                 
 > [7/7] RUN pip3 install -r requirements.txt:                                                         
#0 1.895 Collecting django-sortedm2m@ git+git://github.com/DMOJ/django-sortedm2m.git                   
#0 1.896   Cloning git://github.com/DMOJ/django-sortedm2m.git to /tmp/pip-install-x7xagl8q/django-sortedm2m_7e2bd98493dc427ea92b2ee7930ad96f                                                                  
#0 1.922   Running command git clone --filter=blob:none --quiet git://github.com/DMOJ/django-sortedm2m.git /tmp/pip-install-x7xagl8q/django-sortedm2m_7e2bd98493dc427ea92b2ee7930ad96f
#0 132.4   fatal: unable to connect to github.com:
#0 132.4   github.com[0: 20.205.243.166]: errno=Connection timed out
#0 132.4 
#0 132.4   error: subprocess-exited-with-error
#0 132.4   
#0 132.4   × git clone --filter=blob:none --quiet git://github.com/DMOJ/django-sortedm2m.git /tmp/pip-install-x7xagl8q/django-sortedm2m_7e2bd98493dc427ea92b2ee7930ad96f did not run successfully.
#0 132.4   │ exit code: 128
#0 132.4   ╰─> See above for output.
#0 132.4   
#0 132.4   note: This error originates from a subprocess, and is likely not a problem with pip.
#0 132.5 error: subprocess-exited-with-error
#0 132.5 
#0 132.5 × git clone --filter=blob:none --quiet git://github.com/DMOJ/django-sortedm2m.git /tmp/pip-install-x7xagl8q/django-sortedm2m_7e2bd98493dc427ea92b2ee7930ad96f did not run successfully.
#0 132.5 │ exit code: 128
#0 132.5 ╰─> See above for output.
#0 132.5 
#0 132.5 note: This error originates from a subprocess, and is likely not a problem with pip.
#0 132.5 WARNING: You are using pip version 22.0.4; however, version 23.0.1 is available.
#0 132.5 You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
------
Dockerfile:33
--------------------
  31 |     
  32 |     COPY repo/requirements.txt .
  33 | >>> RUN pip3 install -r requirements.txt
  34 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c pip3 install -r requirements.txt" did not complete successfully: exit code: 1
ERROR: Service 'base' failed to build : Build failed

I'm using conda environment and docker version 23.0.1, build a5ee5b1.

(dmoj2) tien@tien-Inspiron-3543:~/bkdn-oj-docker/dmoj$ sudo docker-compose build
[sudo] password for tien: 
db uses an image, skipping
redis uses an image, skipping
nginx uses an image, skipping
Building texoid
[+] Building 4.1s (9/9) FINISHED                                                                       
 => [internal] load build definition from Dockerfile                                              0.1s
 => => transferring dockerfile: 614B                                                              0.0s
 => [internal] load .dockerignore                                                                 0.0s
 => => transferring context: 2B                                                                   0.0s
 => [internal] load metadata for docker.io/library/debian:buster-slim                             4.0s
 => [1/5] FROM docker.io/library/debian:buster-slim@sha256:eecda7f7a3e9cd93d7748c7643628e3a95d62  0.0s
 => CACHED [2/5] RUN apt-get update &&     apt-get install -y --no-install-recommends         te  0.0s
 => CACHED [3/5] RUN git clone https://github.com/DMOJ/texoid/                                    0.0s
 => CACHED [4/5] WORKDIR /texoid/                                                                 0.0s
 => CACHED [5/5] RUN pip3 install -e .                                                            0.0s
 => exporting to image                                                                            0.0s
 => => exporting layers                                                                           0.0s
 => => writing image sha256:8686860cafbdaad8f982387e9cc3d6103fe68c59497db3f3afdea3e8a9ed097c      0.0s
 => => naming to docker.io/ninjaclasher/dmoj-texoid                                               0.0s
Building mathoid
[+] Building 2.4s (7/7) FINISHED                                                                       
 => [internal] load build definition from Dockerfile                                              0.0s
 => => transferring dockerfile: 229B                                                              0.0s
 => [internal] load .dockerignore                                                                 0.0s
 => => transferring context: 2B                                                                   0.0s
 => [internal] load metadata for docker.io/library/node:10.21.0                                   2.4s
 => [1/3] FROM docker.io/library/node:10.21.0@sha256:f9e66964ec6e9a78693929b58b3d95aadf03cc70e47  0.0s
 => CACHED [2/3] RUN npm install mathoid &&     ln -sfv /node_modules/mathoid/app.js /node_modul  0.0s
 => CACHED [3/3] WORKDIR /node_modules/mathoid                                                    0.0s
 => exporting to image                                                                            0.0s
 => => exporting layers                                                                           0.0s
 => => writing image sha256:2c947dd6572b119b2fc94775ee168f9ebbe98645eed24cf9ec8576bb5074c604      0.0s
 => => naming to docker.io/ninjaclasher/dmoj-mathoid                                              0.0s
Building base
[+] Building 135.3s (11/11) FINISHED                                                                   
 => [internal] load build definition from Dockerfile                                              0.0s
 => => transferring dockerfile: 1.43kB                                                            0.0s
 => [internal] load .dockerignore                                                                 0.0s
 => => transferring context: 2B                                                                   0.0s
 => [internal] load metadata for docker.io/library/python:3.8-slim-buster                         2.6s
 => [internal] load build context                                                                 0.0s
 => => transferring context: 67B                                                                  0.0s
 => [1/7] FROM docker.io/library/python:3.8-slim-buster@sha256:f51af6b4116b1c3a5a7934070b0761d1d  0.0s
 => CACHED [2/7] RUN apt-get update &&     apt-get install -y         git gcc g++ make curl gett  0.0s
 => CACHED [3/7] RUN npm install -g sass postcss-cli postcss autoprefixer                         0.0s
 => CACHED [4/7] RUN pip3 install         pymysql mysqlclient websocket-client uwsgi django-redi  0.0s
 => CACHED [5/7] RUN apt-get update &&     apt-get install -y unzip xvfb libxi6 libgconf-2-4 &&   0.0s
 => CACHED [6/7] COPY repo/requirements.txt .                                                     0.0s
 => ERROR [7/7] RUN pip3 install -r requirements.txt                                            132.7s
------                                                                                                 
 > [7/7] RUN pip3 install -r requirements.txt:                                                         
#0 1.895 Collecting django-sortedm2m@ git+git://github.com/DMOJ/django-sortedm2m.git                   
#0 1.896   Cloning git://github.com/DMOJ/django-sortedm2m.git to /tmp/pip-install-x7xagl8q/django-sortedm2m_7e2bd98493dc427ea92b2ee7930ad96f                                                                  
#0 1.922   Running command git clone --filter=blob:none --quiet git://github.com/DMOJ/django-sortedm2m.git /tmp/pip-install-x7xagl8q/django-sortedm2m_7e2bd98493dc427ea92b2ee7930ad96f
#0 132.4   fatal: unable to connect to github.com:
#0 132.4   github.com[0: 20.205.243.166]: errno=Connection timed out
#0 132.4 
#0 132.4   error: subprocess-exited-with-error
#0 132.4   
#0 132.4   × git clone --filter=blob:none --quiet git://github.com/DMOJ/django-sortedm2m.git /tmp/pip-install-x7xagl8q/django-sortedm2m_7e2bd98493dc427ea92b2ee7930ad96f did not run successfully.
#0 132.4   │ exit code: 128
#0 132.4   ╰─> See above for output.
#0 132.4   
#0 132.4   note: This error originates from a subprocess, and is likely not a problem with pip.
#0 132.5 error: subprocess-exited-with-error
#0 132.5 
#0 132.5 × git clone --filter=blob:none --quiet git://github.com/DMOJ/django-sortedm2m.git /tmp/pip-install-x7xagl8q/django-sortedm2m_7e2bd98493dc427ea92b2ee7930ad96f did not run successfully.
#0 132.5 │ exit code: 128
#0 132.5 ╰─> See above for output.
#0 132.5 
#0 132.5 note: This error originates from a subprocess, and is likely not a problem with pip.
#0 132.5 WARNING: You are using pip version 22.0.4; however, version 23.0.1 is available.
#0 132.5 You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
------
Dockerfile:33
--------------------
  31 |     
  32 |     COPY repo/requirements.txt .
  33 | >>> RUN pip3 install -r requirements.txt
  34 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c pip3 install -r requirements.txt" did not complete successfully: exit code: 1
ERROR: Service 'base' failed to build : Build failed

i try to read an instruction here but can't find any answers https://docs.docker.com/develop/develop-images/dockerfile_best-practices/

Telles Tran
  • 21
  • 1
  • 1
  • 2

1 Answers1

0

install hiht fatal: unable to connect to github.com: errno=Connection timed out

Is there a problem connecting to github

or try it manually

pip install django-sortedm2m==<version>

chrisfang
  • 309
  • 5