I am receiving an exit code: 247
when I try to build a Docker image that downloads a large file. The large file is spaCy's en_core_web_lg
model.
I have tried downloading the en_core_web_md
model and that worked just fine. I also tried not downloading the lg model in the Dockerfile and instead navigate into the container and downloading it using python3 -m spacy download en_core_web_lg
but it then appeard to freeze.
I suspect the issue has to do with the model being 777.1 MB but I am not sure how to address this in the Dockerfile or build command. Any ideas?
Dockerfile
FROM python:3.9
WORKDIR /app
RUN pip3 install spacy
RUN python3 -m spacy download en_core_web_lg
Build command and error
~> docker build -f Dockerfile -t app:latest .
[ ] Building 22.8s (7/7) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 37B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/python:3.9 0.3s
=> [1/4] FROM docker.io/library/python:3.9@sha256:e6654afa815122b13242fc9ff513e2d14b00548ba6eaf4d3b03f2f261d85272d 0.0s
=> CACHED [2/4] WORKDIR /app 0.0s
=> CACHED [3/4] RUN pip3 install spacy 0.0s
=> ERROR [4/4] RUN python3 -m spacy download en_core_web_lg 22.4s
------
~> [4/4] RUN python3 -m spacy download en_core_web_lg:
#6 1.921 Collecting en-core-web-lg==3.1.0
#6 2.125 Downloading https://github.com/explosion/spacy-models/releases/download/en_core_web_lg-3.1.0/en_core_web_lg-3.1.0-py3-none-any.whl (777.1 MB)
------
executor failed running [/bin/sh -c python3 -m spacy download en_core_web_lg]: exit code: 247
CodePudding user response:
Allocate more memory for the Container and apply