我想用 mac 创建一个 docker 环境,我执行出错了
docker git:(main) docker-compose up -d [+] Building 11.3s (13/16) => [internal] load local bake definitions 0.0s => => reading from stdin 557B 0.0s => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 1.11kB 0.0s => [internal] load metadata for ghcr.io/astral-sh/uv:latest 2.2s => [internal] load metadata for docker.io/library/python:3.12-slim-bookw 1.2s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [stage-0 1/9] FROM docker.io/library/python:3.12-slim-bookworm@sha256 0.0s => => resolve docker.io/library/python:3.12-slim-bookworm@sha256:4a3ceab 0.0s => [internal] load build context 0.0s => => transferring context: 3.11kB 0.0s => FROM ghcr.io/astral-sh/uv:latest@sha256:13e233d08517abdafac4ead26c16d 0.0s => => resolve ghcr.io/astral-sh/uv:latest@sha256:13e233d08517abdafac4ead 0.0s => CACHED [stage-0 2/9] WORKDIR /app 0.0s => CACHED [stage-0 3/9] RUN apt-get update && apt-get install -y --no-in 0.0s => CACHED [stage-0 4/9] COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin 0.0s => CACHED [stage-0 5/9] COPY pyproject.toml uv.lock ./ 0.0s => ERROR [stage-0 6/9] RUN uv sync --frozen 8.9s
[stage-0 6/9] RUN uv sync --frozen: 0.185 Using CPython 3.12.12 interpreter at: /usr/local/bin/python3 0.185 Creating virtual environment at: .venv 0.208 Building aistudio2api @ file:///app 1.610 Downloading pygments (1.2MiB) 1.925 Downloading numpy (13.7MiB) 1.926 Downloading pydantic-core (1.8MiB) 1.926 Downloading playwright (36.2MiB) 1.930 Downloading uvloop (4.1MiB) 1.930 Downloading mypy (12.1MiB) 1.931 Downloading aiohttp (1.7MiB) 1.987 Downloading cryptography (4.2MiB) 1.987 Downloading lxml (4.8MiB) 3.415 Building aiosocks==0.2.6 5.931 Downloaded pygments 6.722 Downloaded aiohttp 7.239 Downloaded pydantic-core 8.881 × Failed to build
aistudio2api @ file:///app8.881 ├─▶ The build backend returned an error 8.881 ╰─▶ Call tohatchling.build.build_editablefailed (exit status: 1) 8.881 8.881 [stderr] 8.881 Traceback (most recent call last): 8.881 File "", line 11, in 8.881 File 8.881 "/root/.cache/uv/builds-v0/.tmpChZXVi/lib/python3.12/site-packages/hatchling/build.py", 8.881 line 83, in build_editable 8.881 return os.path.basename(next(builder.build(directory=wheel_directory, 8.881 versions=["editable"]))) 8.881 8.881 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 8.881 File 8.881 "/root/.cache/uv/builds-v0/.tmpChZXVi/lib/python3.12/site-packages/hatchling/builders/plugin/interface.py", 8.881 line 92, in build 8.881 self.metadata.validate_fields() 8.881 File 8.881 "/root/.cache/uv/builds-v0/.tmpChZXVi/lib/python3.12/site-packages/hatchling/metadata/core.py", 8.881 line 266, in validate_fields 8.881 self.core.validate_fields() 8.881 File 8.881 "/root/.cache/uv/builds-v0/.tmpChZXVi/lib/python3.12/site-packages/hatchling/metadata/core.py", 8.881 line 1366, in validate_fields 8.881 getattr(self, attribute) 8.881 File 8.881 "/root/.cache/uv/builds-v0/.tmpChZXVi/lib/python3.12/site-packages/hatchling/metadata/core.py", 8.881 line 531, in readme 8.881 raise OSError(message) 8.881 OSError: Readme file does not exist: README.md 8.881 8.881 hint: This usually indicates a problem with the package or the build 8.881 environment.
[+] up 0/1 ⠙ Image docker-aistudio-proxy Building 11.3s Dockerfile:23
21 |
22 | COPY pyproject.toml uv.lock ./
23 | >>> RUN uv sync --frozen
24 |
25 | COPY src/ ./src/
failed to solve: process "/bin/sh -c uv sync --frozen" did not complete successfully: exit code: 1
View build details: docker-desktop://dashboard/build/default/default/dwct23iy76yhwj5nym0vgh9di
pyproject.toml删除readme = "README.md"