Skip to content

docker部署失败 #2

Description

@Lcq2002

执行maturin develop命令时,提示未找到虚拟环境或conda环境
报错如下:

(cg) PS D:\workspace\CourseGraph> docker-compose -f docker/docker-compose.yml up -d
time="2025-02-23T18:14:54+08:00" level=warning msg="D:\\workspace\\CourseGraph\\docker\\docker-compose.yml: `version` is obsolete"
[+] Building 0.0s (0/0)  docker:default
[+] Building 6097.1s (13/14)                                                                                              docker:default
 => [app internal] load build definition from Dockerfile                                                                            0.0s
 => => transferring dockerfile: 881B                                                                                                0.0s 
 => [app internal] load metadata for docker.io/library/ubuntu:22.04                                                                 3.1s 
 => [app internal] load .dockerignore                                                                                               0.0s
 => => transferring context: 2B                                                                                                     0.0s 
 => CACHED [app  1/10] FROM docker.io/library/ubuntu:22.04@sha256:ed1544e454989078f5dec1bfdabd8c5cc9c48e0705d07b678ab6ae3fb61952d2  0.0s 
 => [app internal] load build context                                                                                               0.1s 
 => => transferring context: 69.98kB                                                                                                0.0s 
 => [app  2/10] RUN apt-get update && apt-get install -y     curl     git     build-essential     pkg-config     libreoffice     1019.2s 
 => [app  3/10] RUN apt-get update && apt-get install -y     python3.10     python3-pip     python3.10-venv     && rm -rf /var/li  80.3s
 => [app  4/10] RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y                                       394.8s
 => [app  5/10] RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -     && apt-get install -y nodejs     && rm -rf /var  55.3s
 => [app  6/10] WORKDIR /app                                                                                                        0.2s 
 => [app  7/10] COPY . .                                                                                                            6.3s 
 => [app  8/10] RUN pip3 install poetry     && poetry config virtualenvs.create false     && poetry install                      4536.3s 
 => ERROR [app  9/10] RUN cd rust && maturin develop && cd ..                                                                       1.1s 
------
 > [app  9/10] RUN cd rust && maturin develop && cd ..:
1.092 💥 maturin failed
1.092   Caused by: Couldn't find a virtualenv or conda environment, but you need one to use this command. For maturin to find your virtualenv you need to either set VIRTUAL_ENV (through activate), set CONDA_PREFIX (through conda activate) or have a virtualenv called .venv in the current or any parent folder. See https://virtualenv.pypa.io/en/latest/index.html on how to use virtualenv or use `maturin build` and `pip install <path/to/wheel>` instead.
------
failed to solve: process "/bin/sh -c cd rust && maturin develop && cd .." did not complete successfully: exit code: 1

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions