fairseq icon indicating copy to clipboard operation
fairseq copied to clipboard

Docker big size

Open Raghad770 opened this issue 2 years ago • 0 comments

how can i remove uneeded deps and models installed with fairseq ? i built a docker image and it's size 9.55 GB , so i need to resize to 2 GB i don't have much experience so if anyone can advice me how to reduce the docker image size i will be grateful

my requirements file:

torch==1.10.1+cu111 -f https://download.pytorch.org/whl/torch_stable.html Cython==0.29.35 fairseq==0.12.2 Flask==2.2.3 grpcio==1.54.2 joblib==1.2.0 loguru==0.7.0 numpy==1.24.2 protobuf==4.23.3 PyYAML==5.3.1 Requests==2.31.0 sentencepiece==0.1.99 setuptools==67.8.0 tqdm==4.65.0 waitress==2.1.2 wheel==0.40.0

Dockerfile

FROM phusion/baseimage:focal-1.2.0 AS base WORKDIR /app COPY ./NT_Trial/ .

RUN apt-get update
&& apt-get install -y
libpython3.8-dev
python3.8-dev
build-essential
ffmpeg
libsm6
libxext6
zip
unzip
python3.8
python3-pip

RUN pip3 install -r ./requirements.txt
&& apt-get update
&& python3 create_manifest_file.py /app/NT_Service
&& python3 setup.py bdist_wheel
&& rm -r /app/NT_Service /app/NT_Service.egg-info /app/build
&& unzip /app/dist/NT_Service-0.1.0-cp38-cp38-linux_x86_64.whl -d /app/dist

ENTRYPOINT ["bash","run_service.sh"]

Raghad770 avatar Oct 23 '23 05:10 Raghad770