23.06.15
DEVOTEE를 활성화 시키면
지금 작성한 커뮤니티 글에 대해 1개의 댓글을 달아줍니다.
버튼을 누르면 글 수정 시 ChatGPT가 작성한 댓글이 수정됩니다.
| 컨텐츠 유형 | 제목 | 저장일 | 삭제 |
|---|
본인인증 로그인에 실패하였습니다.
회원이 아니시거나 본인인증 등록이
완료되지 않은 사용자입니다.
Docker build 시 설치되는 패키지의 의존성으로 기존에 설치된 패키지의 버전이 업/다운그레이드 되는 경우가 있습니다.
이때 아래와 같이 Docker build시 log를 출력해서 uninstall 로 검색하면 버전의 변경되는 것으로 확인 할 수 있습니다.
docker build --progress=plain --no-cache -t { TAG } -f Dockerfile . 2>&1 | tee build.log예를 들어 아래와 같이 pillow 버전이 12.0.0을 제거 하고, 다시 pillow-11.3.0을 설치하고 있다.
만약 다른 패키지만 12.0.0 이 꼭 필요한 패키지가 있으면 해당 패키지는 의존 패키지 버전 미스매칭으로 런타임시 오류가 발생합니다.
#17 5.128 Collecting pillow<12.0,>=8.0 (from gradio==5.25.2)
#17 5.133 Downloading pillow-11.3.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.metadata (9.0 kB)
...
#17 102.2 Installing collected packages: pydub, easydict, yt-dlp, websockets, uvicorn, typing-inspection, typer-slim, toolz, tomlkit, tensorboardX, shellingham, semantic-version, scenedetect, safetensors, ruff, python-multipart, pydantic-core, propcache, pillow, orjson, opt_einsum, multidict, ml_dtypes, mdurl, lz4, loguru, lightning-utilities, kornia_rs, imageio-ffmpeg, hf-xet, groovy, frozenlist, ffmpy, einshape, einops, async-timeout, annotated-types, annotated-doc, aiohappyeyeballs, aiofiles, yarl, pydantic, markdown-it-py, jaxlib, aiosignal, xformers, torchmetrics, starlette, spatial-correlation-sampler, rich, mediapy, kornia, jax, ipdb, fairscale, aiohttp, typer, safehttpx, huggingface-hub, fastapi, chex, timm, pytorch-lightning, gradio-client, lightning, gradio
#17 105.4 Attempting uninstall: pillow
#17 105.4 Found existing installation: pillow 12.0.0
#17 105.4 Uninstalling pillow-12.0.0:
#17 105.6 Successfully uninstalled pillow-12.0.0
#17 117.8
#17 117.8 Successfully installed aiofiles-24.1.0 aiohappyeyeballs-2.6.1 aiohttp-3.13.2 aiosignal-1.4.0 annotated-doc-0.0.3 annotated-types-0.7.0 async-timeout-5.0.1 chex-0.1.90 easydict-1.13 einops-0.8.1 einshape-1.0 fairscale-0.4.13 fastapi-0.121.0 ffmpy-0.6.4 frozenlist-1.8.0 gradio-5.25.2 gradio-client-1.8.0 groovy-0.1.2 hf-xet-1.2.0 huggingface-hub-1.1.1 imageio-ffmpeg-0.6.0 ipdb-0.13.13 jax-0.6.2 jaxlib-0.6.2 kornia-0.8.1 kornia_rs-0.1.9 lightning-2.5.6 lightning-utilities-0.15.2 loguru-0.7.3 lz4-4.4.5 markdown-it-py-4.0.0 mdurl-0.1.2 mediapy-1.2.4 ml_dtypes-0.5.3 multidict-6.7.0 opt_einsum-3.4.0 orjson-3.11.4 pillow-11.3.0 propcache-0.4.1 pydantic-2.11.10 pydantic-core-2.33.2 pydub-0.25.1 python-multipart-0.0.20 pytorch-lightning-2.5.6 rich-14.2.0 ruff-0.14.3 safehttpx-0.1.7 safetensors-0.6.2 scenedetect-0.6.7.1 semantic-version-2.10.0 shellingham-1.5.4 spatial-correlation-sampler-0.4.0 starlette-0.49.3 tensorboardX-2.6.4 timm-1.0.22 tomlkit-0.13.3 toolz-1.1.0 torchmetrics-1.8.2 typer-0.20.0 typer-slim-0.20.0 typing-inspection-0.4.2 uvicorn-0.38.0 websockets-15.0.1 xformers-0.0.22.post7 yarl-1.22.0 yt-dlp-2025.10.22
#17 DONE 131.1s위의 로그의 첫째줄을 잘 보면 Dockerfile의 17번째 명령에서 "pillow<12.0,>=8.0 (from gradio==5.25.2)"와 같이 gradio 패키지의 호환성이 pillow<12.0,>=8.0 인것을 알 수 있습니다.
따라서 pillow 패키지를 12.0.0을 제거하고 pillow 11.3.0 으로 다운 그레이드 했음을 알 수 있습니다.
그리고, 아래의 로그에서 pillow가 언제 최초로 설치되는지를 확인해보면
Dockerfile의 11번째 명령에서 Torch Vision의 의존성으로 "pillow!=8.3.,>=5.3.0 (from torchvision==0.16.0)" 과 같이 5.3.0 버전이상 중 8.3. 버전만 제외하고 설치 하도록 되어 있습니다.
#11 [stage-0 8/15] RUN pip install "numpy<2.0" "requests>=2.31" torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu121 --extra-index-url https://pypi.org/simple
...
#11 64.23 Collecting pillow!=8.3.*,>=5.3.0 (from torchvision==0.16.0)
#11 64.24 Downloading pillow-12.0.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.metadata (8.8 kB)따라서 Dockerfile에서 최초로 pillow가 의존성으로 설치되는 부분에서 버전을 지정해주면 해당 버전이 설치되어 패키지가 재설치 되는 경우가 없어 집니다.
RUN pip install "numpy<2.0" "requests>=2.31" torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 \
--index-url https://download.pytorch.org/whl/cu121 \
--extra-index-url https://pypi.org/simple아래의 torch 설치시 numpy, requests도 호환성 문제를 해결하기 위해 미리 버전을 지정하여 재설치 되는 문제를 해결하였습니다.
RUN pip install "numpy<2.0" "requests>=2.31" "pillow<12.0,>8.3" torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 \
--index-url https://download.pytorch.org/whl/cu121 \
--extra-index-url https://pypi.org/simple
DEVOTEE를 활성화 시키면
지금 작성한 댓글에 AI가 댓글을 달아줍니다.