Skip to content

DockerFile issue when building the docker image #62

Open

Description

@felixchan68

Hi,

I try to build the docker image using the command
docker build -t "rvc" .

The build fails and error message below:

ERROR: failed to solve: process "/bin/bash -c pip install --no-cache-dir "poetry==1.7.1" && poetry config virtualenvs.create false && poetry install --no-interaction --no-root && poetry cache clear --all ." did not complete successfully: exit code: 1

Any hints or update version for the docker file? Thank you very much.

Activity

  1. sebi2306 commented on Nov 6, 2025

    @sebi2306

    More specifically pkg-config could not find libraries ['avformat', 'avcodec', 'avdevice', 'avutil', 'avfilter', 'swscale', 'swresample'] (arm64) and on amd64 it complains about AV_CODEC_CAP_OTHER_THREADS being undeclared

  2. tqk2811 commented on Nov 10, 2025

    @tqk2811

    add this to Dockerfile (amd64)

    RUN mkdir -p /opt/ffmpeg && \
        wget -q https://github.com/tqk2811/FFmpeg-Builds/releases/download/Release/ffmpeg-n6.1.3-1-ge33b4d8ad6-linux64-gpl-shared-6.1.tar.xz -O /tmp/ffmpeg.tar.xz && \
        tar -xJf /tmp/ffmpeg.tar.xz -C /opt/ffmpeg --strip-components=1 && \
        ln -s /opt/ffmpeg/ffmpeg /usr/local/bin/ffmpeg && \
        ln -s /opt/ffmpeg/ffprobe /usr/local/bin/ffprobe && \
        ldconfig && \
        rm -rf /tmp/ffmpeg.tar.xz
    ENV PKG_CONFIG_PATH=/opt/ffmpeg/lib/pkgconfig:$PKG_CONFIG_PATH
    ENV LD_LIBRARY_PATH=/opt/ffmpeg/lib:$LD_LIBRARY_PATH
    

    Full Dockerfile

    FROM alpine:3.19.1 as assets
    
    RUN apk add \
          --update \
          --no-cache \
            bash \
            git \
            git-lfs\
            dos2unix
    
    COPY --chmod=755 ./assets-download.sh /assets-download.sh
    
    #convert malformed line endings if cloned from Windows
    RUN dos2unix /assets-download.sh
    
    RUN /assets-download.sh 88e42f0cb3662ddc0dd263a4814206ce96d53214 assets
    
    FROM python:3.10.14-bullseye as app
    
    SHELL [ "/bin/bash", "-c" ]
    
    RUN apt update && \
        apt install -y \
          libsndfile1 \
          libsndfile1-dev && \
        apt clean && \
        rm -rf /var/lib/apt/lists/*
    RUN mkdir -p /opt/ffmpeg && \
        wget -q https://github.com/tqk2811/FFmpeg-Builds/releases/download/Release/ffmpeg-n6.1.3-1-ge33b4d8ad6-linux64-gpl-shared-6.1.tar.xz -O /tmp/ffmpeg.tar.xz && \
        tar -xJf /tmp/ffmpeg.tar.xz -C /opt/ffmpeg --strip-components=1 && \
        ln -s /opt/ffmpeg/ffmpeg /usr/local/bin/ffmpeg && \
        ln -s /opt/ffmpeg/ffprobe /usr/local/bin/ffprobe && \
        ldconfig && \
        rm -rf /tmp/ffmpeg.tar.xz
    
    COPY --from=assets /assets /assets
    
    WORKDIR /app
    
    COPY ./pyproject.toml .
    ENV PKG_CONFIG_PATH=/opt/ffmpeg/lib/pkgconfig:$PKG_CONFIG_PATH
    ENV LD_LIBRARY_PATH=/opt/ffmpeg/lib:$LD_LIBRARY_PATH
    
    RUN pip install \
          --no-cache-dir \
          "poetry==1.7.1" && \
        poetry config virtualenvs.create false && \
        poetry install \
          --no-interaction \
          --no-root && \
        poetry cache clear --all .
    
    COPY ./rvc ./rvc
    COPY ./.env-docker ./.env
    
    CMD [ "poetry", "run", "poe", "rvc-api" ]
  3. felixchan68 commented on Nov 11, 2025

    @felixchan68
    Author

    @tqk2811

    Thanks, but still got the same error:

    Dockerfile:44

    43 |
    44 | >>> RUN pip install
    45 | >>> --no-cache-dir
    46 | >>> "poetry==1.7.1" &&
    47 | >>> poetry config virtualenvs.create false &&
    48 | >>> poetry install
    49 | >>> --no-interaction
    50 | >>> --no-root &&
    51 | >>> poetry cache clear --all .
    52 |

    ERROR: failed to solve: process "/bin/bash -c pip install --no-cache-dir "poetry==1.7.1" && poetry config virtualenvs.create false && poetry install --no-interaction --no-root && poetry cache clear --all ." did not complete successfully: exit code: 1

    Is there anyway to fix the DockerFile in git to make it work? I try to perform using custom nvidia + python in docker container install but no luck since RVC only support python < 3.12, and find out lots of issues during the docker build process.

  4. sebi2306 commented on Nov 11, 2025

    @sebi2306

    @felixchan68 take this one and modify as needed (tested only on arm64)

    FROM python:3.10-slim
    
    ARG UID=1000
    ARG GID=1000
    
    ENV DEBIAN_FRONTEND=noninteractive \
        PYTHONUNBUFFERED=1 \
        PIP_NO_CACHE_DIR=1 \
        PIP_DISABLE_PIP_VERSION_CHECK=1
    
    RUN apt update && \
        apt install -y \
          build-essential g++ \
          libsndfile1-dev libavformat-dev libavdevice-dev ffmpeg git && \
        apt clean && \
        rm -rf /var/lib/apt/lists/*
    
    RUN groupadd -g ${GID} user && \
        useradd -m -u ${UID} -g ${GID} -s /bin/bash user
    
    USER user
    
    WORKDIR /home/user
    
    # 1) Clone
    RUN git clone --depth=1 https://github.com/RVC-Project/Retrieval-based-Voice-Conversion RVC
    
    # 2) Patch pyproject to bump av
    RUN sed -Ei 's/av = "\^11\.[^"]*"/av = "^16.0.0"/' /home/user/RVC/pyproject.toml
    
    # 3) Install the project
    WORKDIR /home/user/RVC
    RUN python -m pip install --upgrade pip setuptools wheel && \
        pip install .
    
    # 4) Add rvc to PATH
    ENV PATH=/home/user/.local/bin:${PATH}
    
    ENTRYPOINT ["rvc"]

    P.S. post more of the error in the future, you only posted the Dockerfile command that went wrong not why, though I suspect it's AV issues

    Example from Dockerfile in this repo using docker build --progress=plain:

    #16 196.2   src/av/codec/codec.c:7180:49: error: ‘AV_CODEC_CAP_OTHER_THREADS’ undeclared (first use in this function); d
    id you mean ‘AV_CODEC_CAP_SLICE_THREADS’?
    #16 196.2    7180 |   __pyx_t_9 = __Pyx_PyLong_From___pyx_anon_enum(AV_CODEC_CAP_OTHER_THREADS); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 104, __pyx_L1_error)
    #16 196.2         |                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
    #16 196.2         |                                                 AV_CODEC_CAP_SLICE_THREADS
    #16 196.2   src/av/codec/codec.c:7180:49: note: each undeclared identifier is reported only once for each function it appears in
    #16 196.2   error: command '/usr/bin/gcc' failed with exit code 1
    
  5. rsxdalv commented on Nov 13, 2025

    @rsxdalv
    Contributor

    Context - av deleted their wheels for version 11 (due to pypi limitations) that's why it suddenly broke

  6. felixchan68 commented on Nov 19, 2025

    @felixchan68
    Author

    @sebi2306 Thank you very much and its amazingly work. The docker image can be successfully built.

    Unfortunitely I experienced another issue. I simply try to execute the rvc but error message comes out. Did I make any mistakes?

    docker run -it --name rvc --gpus all -p 8000:8000 -v ./data/assets/weights:/weights:ro -v ./data/assets/indices:/indices:ro -v ./data/assets/audios:/audios rvc infer -m /weights/egirl.pth -i /audios/test.wav -o /audios/test_out.wav -if /indices/egirl.index

    Execution result:
    /home/user/.local/lib/python3.10/site-packages/pyworld/init.py:13: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
    import pkg_resources
    2025-11-19 08:09:00 | INFO | rvc.configs.config | Found GPU NVIDIA GeForce RTX 5060 Ti
    2025-11-19 08:09:00 | INFO | rvc.configs.config | Use None instead
    2025-11-19 08:09:00 | INFO | rvc.configs.config | is_half:True, device:cuda:0
    2025-11-19 08:09:00 | INFO | rvc.modules.vc.modules | Get sid: egirl.pth
    2025-11-19 08:09:00 | INFO | rvc.modules.vc.modules | Loading: /weights/egirl.pth
    /home/user/.local/lib/python3.10/site-packages/torch/nn/utils/weight_norm.py:144: FutureWarning: torch.nn.utils.weight_norm is deprecated in favor of torch.nn.utils.parametrizations.weight_norm.
    WeightNorm.apply(module, name, dim)
    Traceback (most recent call last):
    File "/home/user/.local/bin/rvc", line 7, in
    sys.exit(main())
    File "/home/user/.local/lib/python3.10/site-packages/rvc/wrapper/cli/cli.py", line 29, in main
    cli()
    File "/home/user/.local/lib/python3.10/site-packages/click/core.py", line 1485, in call
    return self.main(*args, **kwargs)
    File "/home/user/.local/lib/python3.10/site-packages/click/core.py", line 1406, in main
    rv = self.invoke(ctx)
    File "/home/user/.local/lib/python3.10/site-packages/click/core.py", line 1873, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "/home/user/.local/lib/python3.10/site-packages/click/core.py", line 1269, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File "/home/user/.local/lib/python3.10/site-packages/click/core.py", line 824, in invoke
    return callback(*args, **kwargs)
    File "/home/user/.local/lib/python3.10/site-packages/rvc/wrapper/cli/handler/infer.py", line 114, in infer
    vc.get_vc(modelpath)
    File "/home/user/.local/lib/python3.10/site-packages/rvc/modules/vc/modules.py", line 92, in get_vc
    index = get_index_path_from_model(sid)
    File "/home/user/.local/lib/python3.10/site-packages/rvc/modules/vc/utils.py", line 12, in get_index_path_from_model
    for root, _, files in os.walk(os.getenv("index_root"), topdown=False)
    File "/usr/local/lib/python3.10/os.py", line 343, in walk
    return _walk(fspath(top), topdown, onerror, followlinks)
    TypeError: expected str, bytes or os.PathLike object, not NoneType

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions