Skip to content

Docker build failing #3

@EskelCz

Description

@EskelCz

When trying to deploy the project locally using docker compose up, it fails with the following error:

 => ERROR [runtime 8/8] RUN pip install --no-cache-dir -e ".[redis]"                                                                                                      2.5s 
------                                                                                                                                                                         
 > [runtime 8/8] RUN pip install --no-cache-dir -e ".[redis]":                                                                                                                 
0.613 Obtaining file:///app                                                                                                                                                    
0.614   Installing build dependencies: started                                                                                                                                 
1.598   Installing build dependencies: finished with status 'done'                                                                                                             
1.598   Checking if build backend supports build_editable: started                                                                                                             
1.622   Checking if build backend supports build_editable: finished with status 'done'
1.622   Getting requirements to build editable: started
1.703   Getting requirements to build editable: finished with status 'done'
1.704   Installing backend dependencies: started
2.215   Installing backend dependencies: finished with status 'done'
2.216   Preparing editable metadata (pyproject.toml): started
2.301   Preparing editable metadata (pyproject.toml): finished with status 'error'
2.304   error: subprocess-exited-with-error
2.304   
2.304   × Preparing editable metadata (pyproject.toml) did not run successfully.
2.304   │ exit code: 1
2.304   ╰─> [29 lines of output]
2.304       Traceback (most recent call last):
2.304         File "/opt/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 195, in prepare_metadata_for_build_editable
2.304           hook = backend.prepare_metadata_for_build_editable
2.304                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2.304       AttributeError: module 'hatchling.build' has no attribute 'prepare_metadata_for_build_editable'
2.304       
2.304       During handling of the above exception, another exception occurred:
2.304       
2.304       Traceback (most recent call last):
2.304         File "/opt/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
2.304           main()
2.304         File "/opt/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
2.304           json_out["return_val"] = hook(**hook_input["kwargs"])
2.304                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2.304         File "/opt/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 204, in prepare_metadata_for_build_editable
2.304           whl_basename = build_hook(metadata_directory, config_settings)
2.304                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2.304         File "/tmp/pip-build-env-tm04s1r_/overlay/lib/python3.12/site-packages/hatchling/build.py", line 83, in build_editable
2.304           return os.path.basename(next(builder.build(directory=wheel_directory, versions=["editable"])))
2.304                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2.304         File "/tmp/pip-build-env-tm04s1r_/overlay/lib/python3.12/site-packages/hatchling/builders/plugin/interface.py", line 92, in build
2.304           self.metadata.validate_fields()
2.304         File "/tmp/pip-build-env-tm04s1r_/overlay/lib/python3.12/site-packages/hatchling/metadata/core.py", line 266, in validate_fields
2.304           self.core.validate_fields()
2.304         File "/tmp/pip-build-env-tm04s1r_/overlay/lib/python3.12/site-packages/hatchling/metadata/core.py", line 1366, in validate_fields
2.304           getattr(self, attribute)
2.304         File "/tmp/pip-build-env-tm04s1r_/overlay/lib/python3.12/site-packages/hatchling/metadata/core.py", line 531, in readme
2.304           raise OSError(message)
2.304       OSError: Readme file does not exist: README.md
2.304       [end of output]
2.304   
2.304   note: This error originates from a subprocess, and is likely not a problem with pip.
2.409 error: metadata-generation-failed
2.409 
2.409 × Encountered error while generating package metadata.
2.409 ╰─> from file:///app
2.409 
[+] up 21/22This is an issue with the package mentioned above, not pip.
 ✔ Image redis:7-alpine     Pulled                                                                                                                                       19.5s
 ✔ Image postgres:16-alpine Pulled                                                                                                                                       48.7s
 ⠙ Image docker-app         Building                                                                                                                                     173.5s
Dockerfile:60

--------------------

  58 |     

  59 |     # Install the package in the runtime venv (editable so src/ is on path)

  60 | >>> RUN pip install --no-cache-dir -e ".[redis]"

  61 |     

  62 |     # Switch to non-root user

--------------------

failed to solve: process "/bin/sh -c pip install --no-cache-dir -e \".[redis]\"" did not complete successfully: exit code: 1

Seems like it's failing to access the README.md file.

System: MacOS Tahoe Version 26.3.1 (25D2128)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions