1

I keep getting a timeout on an image build.

There doesn't seem to be a way to increase the timeout limit for the build. Is there some way to point to local files so they don't have to be downloaded?

Dockerfile

FROM amazon/aws-lambda-python:3.8
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY src ./
CMD ["app.handler"]

requirement.txt

sentence-transformers

Console output

myname$ docker build .
[+] Building 0.1s (2/2) FINISHED                                                                                                                                            
 => [internal] load build definition from Dockerfile                                                                                                                   0.0s
 => => transferring dockerfile: 2B                                                                                                                                     0.0s
 => CANCELED [internal] load .dockerignore                                                                                                                             0.0s
 => => transferring context:                                                                                                                                           0.0s
failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount237517315/Dockerfile: no such file or directory
Wills-MBP:encoding willjc$ docker build ./app
[+] Building 116.2s (8/9)                                                                                                                                                   
 => [internal] load build definition from Dockerfile                                                                                                                   0.0s
 => => transferring dockerfile: 173B                                                                                                                                   0.0s
 => [internal] load .dockerignore                                                                                                                                      0.0s
 => => transferring context: 2B                                                                                                                                        0.0s
 => [internal] load metadata for docker.io/amazon/aws-lambda-python:3.8                                                                                                0.9s
 => [auth] amazon/aws-lambda-python:pull token for registry-1.docker.io                                                                                                0.0s
 => [1/4] FROM docker.io/amazon/aws-lambda-python:3.8@sha256:712a2f44c56a45b927b4d906696ce7678f83e364956f1fce89944c43e83260c6                                          0.0s
 => [internal] load build context                                                                                                                                      0.0s
 => => transferring context: 1.60kB                                                                                                                                    0.0s
 => CACHED [2/4] COPY requirements.txt .                                                                                                                               0.0s
 => ERROR [3/4] RUN pip install -r requirements.txt                                                                                                                  115.1s
------                                                                                                                                                                      
 > [3/4] RUN pip install -r requirements.txt:                                                                                                                               
#8 1.430 Collecting sentence-transformers                                                                                                                                   
#8 1.534   Downloading sentence-transformers-1.0.4.tar.gz (74 kB)                                                                                                           
#8 1.960 Collecting transformers<5.0.0,>=3.1.0                                                                                                                              
#8 1.978   Downloading transformers-4.5.0-py3-none-any.whl (2.1 MB)                                                                                                         
#8 2.661 Collecting tqdm
#8 2.674   Downloading tqdm-4.60.0-py2.py3-none-any.whl (75 kB)
#8 2.781 Collecting torch>=1.6.0
#8 2.805   Downloading torch-1.8.1-cp38-cp38-manylinux1_x86_64.whl (804.1 MB)
------
executor failed running [/bin/sh -c pip install -r requirements.txt]: exit code: 137
wcjord
  • 499
  • 3
  • 14

3 Answers3

2

I tried

docker build . -m 30g

with no luck. Going into Preferences > Resources and increasing several things there yielded results. I thought that's what -m was for but

enter image description here

wcjord
  • 499
  • 3
  • 14
  • Yeah, this error is "the machine is out of ram", not a thing a command line option could help with. That interface increases the total memory available to the VM that docker is running on. – Paul Becotte Apr 12 '21 at 12:38
1

Error code 137 isn't a timeout, its a memory kill. The step it is doing is compiling a large machine learning binary, which is memory intensive. Increase the memory available to your build machine.

Paul Becotte
  • 9,767
  • 3
  • 34
  • 42
  • Is it possible that it's something else? I've increased the memory to 30g and am getting the same error. – wcjord Apr 09 '21 at 20:36
0

Please refer to this question : Failed To Resolve With FrontEnd DockerFIle.v0

Also make sure your Dockerfile is correct, I can’t see you are create it from a base image.

LeoMan
  • 139
  • 1
  • 1
  • 6