Skip to content

Broken Dockerbuild in current template #15

@Breee

Description

@Breee

The current dockerbuild seems to be broken. I have not dig deeper yet why that happens.

$ docker build .
[+] Building 13.2s (12/14)                                                                                                                                               docker:default
 => [internal] load .dockerignore                                                                                                                                                  0.0s
 => => transferring context: 2B                                                                                                                                                    0.0s
 => [internal] load build definition from Dockerfile                                                                                                                               0.0s
 => => transferring dockerfile: 1.53kB                                                                                                                                             0.0s
 => resolve image config for docker.io/docker/dockerfile:1                                                                                                                         1.4s
 => CACHED docker-image://docker.io/docker/dockerfile:1@sha256:ac85f380a63b13dfcefa89046420e1781752bab202122f8f50032edf31be0021                                                    0.0s
 => [internal] load metadata for gcr.io/distroless/python3-debian12:latest                                                                                                         0.5s
 => [internal] load metadata for docker.io/library/debian:12-slim                                                                                                                  0.7s
 => [build 1/5] FROM docker.io/library/debian:12-slim@sha256:f80c45482c8d147da87613cb6878a7238b8642bcc24fc11bad78c7bec726f340                                                      0.0s
 => [internal] load build context                                                                                                                                                  0.1s
 => => transferring context: 101.02kB                                                                                                                                              0.1s
 => CACHED [image 1/3] FROM gcr.io/distroless/python3-debian12:latest@sha256:a79c243bfb51021d2d08f6ea977396c3f1f416a49566306397776e6710a0735e                                      0.0s
 => CACHED [build 2/5] RUN --mount=type=cache,target=/var/lib/apt/lists     --mount=type=cache,target=/var/cache/apt     rm -f /etc/apt/apt.conf.d/docker-clean     && apt-get up  0.0s
 => CACHED [build 3/5] WORKDIR /build                                                                                                                                              0.0s
 => ERROR [build 4/5] RUN --mount=target=.     --mount=type=cache,target=/root/.cache/pip     python3 -m venv /venv/build     && /venv/build/bin/pip install hatch     && /venv/  10.7s
------                                                                                                                                                                                  
 > [build 4/5] RUN --mount=target=.     --mount=type=cache,target=/root/.cache/pip     python3 -m venv /venv/build     && /venv/build/bin/pip install hatch     && /venv/build/bin/hatch build -t wheel /whl:                                                                                                                                                                   
2.853 Collecting hatch                                                                                                                                                                  
2.854   Using cached hatch-1.9.1-py3-none-any.whl (110 kB)                                                                                                                              
2.906 Collecting click>=8.0.6                                                                                                                                                           
2.907   Using cached click-8.1.7-py3-none-any.whl (97 kB)
2.950 Collecting hatchling>=1.21.0
2.951   Using cached hatchling-1.21.0-py3-none-any.whl (76 kB)
3.000 Collecting httpx>=0.22.0
3.001   Using cached httpx-0.26.0-py3-none-any.whl (75 kB)
3.037 Collecting hyperlink>=21.0.0
3.038   Using cached hyperlink-21.0.0-py2.py3-none-any.whl (74 kB)
3.099 Collecting keyring>=23.5.0
3.100   Using cached keyring-24.3.0-py3-none-any.whl (38 kB)
3.153 Collecting packaging>=21.3
3.154   Using cached packaging-23.2-py3-none-any.whl (53 kB)
3.194 Collecting pexpect~=4.8
3.195   Using cached pexpect-4.9.0-py2.py3-none-any.whl (63 kB)
3.240 Collecting platformdirs>=2.5.0
3.241   Using cached platformdirs-4.1.0-py3-none-any.whl (17 kB)
3.314 Collecting rich>=11.2.0
3.315   Using cached rich-13.7.0-py3-none-any.whl (240 kB)
3.360 Collecting shellingham>=1.4.0
3.361   Using cached shellingham-1.5.4-py2.py3-none-any.whl (9.8 kB)
3.398 Collecting tomli-w>=1.0
3.399   Using cached tomli_w-1.0.0-py3-none-any.whl (6.0 kB)
3.447 Collecting tomlkit>=0.11.1
3.448   Using cached tomlkit-0.12.3-py3-none-any.whl (37 kB)
3.486 Collecting userpath~=1.7
3.487   Using cached userpath-1.9.1-py3-none-any.whl (9.1 kB)
3.567 Collecting virtualenv>=20.16.2
3.579   Using cached virtualenv-20.25.0-py3-none-any.whl (3.8 MB)
3.694 Collecting zstandard<1
3.711   Using cached zstandard-0.22.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.4 MB)
3.787 Collecting editables>=0.3
3.788   Using cached editables-0.5-py3-none-any.whl (5.1 kB)
3.827 Collecting pathspec>=0.10.1
3.828   Using cached pathspec-0.12.1-py3-none-any.whl (31 kB)
3.874 Collecting pluggy>=1.0.0
3.875   Using cached pluggy-1.3.0-py3-none-any.whl (18 kB)
3.921 Collecting trove-classifiers
3.923   Using cached trove_classifiers-2023.11.29-py3-none-any.whl (13 kB)
3.985 Collecting anyio
3.986   Using cached anyio-4.2.0-py3-none-any.whl (85 kB)
4.024 Collecting certifi
4.025   Using cached certifi-2023.11.17-py3-none-any.whl (162 kB)
4.078 Collecting httpcore==1.*
4.079   Using cached httpcore-1.0.2-py3-none-any.whl (76 kB)
4.125 Collecting idna
4.126   Using cached idna-3.6-py3-none-any.whl (61 kB)
4.188 Collecting sniffio
4.188   Using cached sniffio-1.3.0-py3-none-any.whl (10 kB)
4.236 Collecting h11<0.15,>=0.13
4.237   Using cached h11-0.14.0-py3-none-any.whl (58 kB)
4.296 Collecting jaraco.classes
4.296   Using cached jaraco.classes-3.3.0-py3-none-any.whl (5.9 kB)
4.359 Collecting importlib-metadata>=4.11.4
4.360   Using cached importlib_metadata-7.0.1-py3-none-any.whl (23 kB)
4.412 Collecting SecretStorage>=3.2
4.413   Using cached SecretStorage-3.3.3-py3-none-any.whl (15 kB)
4.478 Collecting jeepney>=0.4.2
4.479   Using cached jeepney-0.8.0-py3-none-any.whl (48 kB)
4.518 Collecting ptyprocess>=0.5
4.519   Using cached ptyprocess-0.7.0-py2.py3-none-any.whl (13 kB)
4.591 Collecting markdown-it-py>=2.2.0
4.592   Using cached markdown_it_py-3.0.0-py3-none-any.whl (87 kB)
4.645 Collecting pygments<3.0.0,>=2.13.0
4.649   Using cached pygments-2.17.2-py3-none-any.whl (1.2 MB)
4.709 Collecting distlib<1,>=0.3.7
4.710   Using cached distlib-0.3.8-py2.py3-none-any.whl (468 kB)
4.764 Collecting filelock<4,>=3.12.2
4.765   Using cached filelock-3.13.1-py3-none-any.whl (11 kB)
4.835 Collecting zipp>=0.5
4.835   Using cached zipp-3.17.0-py3-none-any.whl (7.4 kB)
4.903 Collecting mdurl~=0.1
4.904   Using cached mdurl-0.1.2-py3-none-any.whl (10.0 kB)
5.113 Collecting cryptography>=2.0
5.124   Using cached cryptography-41.0.7-cp37-abi3-manylinux_2_28_x86_64.whl (4.4 MB)
5.221 Collecting more-itertools
5.222   Using cached more_itertools-10.1.0-py3-none-any.whl (55 kB)
5.410 Collecting cffi>=1.12
5.411   Using cached cffi-1.16.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (464 kB)
5.475 Collecting pycparser
5.475   Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
5.636 Installing collected packages: trove-classifiers, ptyprocess, distlib, zstandard, zipp, tomlkit, tomli-w, sniffio, shellingham, pygments, pycparser, pluggy, platformdirs, pexpect, pathspec, packaging, more-itertools, mdurl, jeepney, idna, h11, filelock, editables, click, certifi, virtualenv, userpath, markdown-it-py, jaraco.classes, importlib-metadata, hyperlink, httpcore, hatchling, cffi, anyio, rich, httpx, cryptography, SecretStorage, keyring, hatch
8.042 Successfully installed SecretStorage-3.3.3 anyio-4.2.0 certifi-2023.11.17 cffi-1.16.0 click-8.1.7 cryptography-41.0.7 distlib-0.3.8 editables-0.5 filelock-3.13.1 h11-0.14.0 hatch-1.9.1 hatchling-1.21.0 httpcore-1.0.2 httpx-0.26.0 hyperlink-21.0.0 idna-3.6 importlib-metadata-7.0.1 jaraco.classes-3.3.0 jeepney-0.8.0 keyring-24.3.0 markdown-it-py-3.0.0 mdurl-0.1.2 more-itertools-10.1.0 packaging-23.2 pathspec-0.12.1 pexpect-4.9.0 platformdirs-4.1.0 pluggy-1.3.0 ptyprocess-0.7.0 pycparser-2.21 pygments-2.17.2 rich-13.7.0 shellingham-1.5.4 sniffio-1.3.0 tomli-w-1.0.0 tomlkit-0.12.3 trove-classifiers-2023.11.29 userpath-1.9.1 virtualenv-20.25.0 zipp-3.17.0 zstandard-0.22.0
8.404 ──────────────────────────────────── wheel ─────────────────────────────────────
8.406 Setting up build environment
10.54 Traceback (most recent call last):
10.54   File "<frozen runpy>", line 198, in _run_module_as_main
10.54   File "<frozen runpy>", line 88, in _run_code
10.54   File "/root/.local/share/hatch/env/virtual/function-template-python/XDF0t07c/function-template-python-build/lib/python3.11/site-packages/hatchling/__main__.py", line 6, in <module>
10.54     sys.exit(hatchling())
10.54              ^^^^^^^^^^^
10.54   File "/root/.local/share/hatch/env/virtual/function-template-python/XDF0t07c/function-template-python-build/lib/python3.11/site-packages/hatchling/cli/__init__.py", line 26, in hatchling
10.54     command(**kwargs)
10.54   File "/root/.local/share/hatch/env/virtual/function-template-python/XDF0t07c/function-template-python-build/lib/python3.11/site-packages/hatchling/cli/build/__init__.py", line 75, in build_impl
10.54     for artifact in builder.build(
10.54   File "/root/.local/share/hatch/env/virtual/function-template-python/XDF0t07c/function-template-python-build/lib/python3.11/site-packages/hatchling/builders/plugin/interface.py", line 155, in build
10.54     artifact = version_api[version](directory, **build_data)
10.54                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10.54   File "/root/.local/share/hatch/env/virtual/function-template-python/XDF0t07c/function-template-python-build/lib/python3.11/site-packages/hatchling/builders/wheel.py", line 412, in build_standard
10.54     for included_file in self.recurse_included_files():
10.54   File "/root/.local/share/hatch/env/virtual/function-template-python/XDF0t07c/function-template-python-build/lib/python3.11/site-packages/hatchling/builders/plugin/interface.py", line 176, in recurse_included_files
10.54     yield from self.recurse_selected_project_files()
10.54   File "/root/.local/share/hatch/env/virtual/function-template-python/XDF0t07c/function-template-python-build/lib/python3.11/site-packages/hatchling/builders/plugin/interface.py", line 180, in recurse_selected_project_files
10.54     if self.config.only_include:
10.54        ^^^^^^^^^^^^^^^^^^^^^^^^
10.54   File "/root/.local/share/hatch/env/virtual/function-template-python/XDF0t07c/function-template-python-build/lib/python3.11/site-packages/hatchling/builders/config.py", line 781, in only_include
10.54     only_include = only_include_config.get('only-include', self.default_only_include()) or self.packages
10.54                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
10.54   File "/root/.local/share/hatch/env/virtual/function-template-python/XDF0t07c/function-template-python-build/lib/python3.11/site-packages/hatchling/builders/wheel.py", line 231, in default_only_include
10.54     return self.default_file_selection_options.only_include
10.54            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10.54   File "/usr/lib/python3.11/functools.py", line 1001, in __get__
10.54     val = self.func(instance)
10.54           ^^^^^^^^^^^^^^^^^^^
10.54   File "/root/.local/share/hatch/env/virtual/function-template-python/XDF0t07c/function-template-python-build/lib/python3.11/site-packages/hatchling/builders/wheel.py", line 219, in default_file_selection_options
10.54     raise ValueError(message)
10.54 ValueError: Unable to determine which files to ship inside the wheel using the following heuristics: https://hatch.pypa.io/latest/plugins/builder/wheel/#default-file-selection
10.54 
10.54 At least one file selection option must be defined in the `tool.hatch.build.targets.wheel` table, see: https://hatch.pypa.io/latest/config/build/
10.54 
10.54 As an example, if you intend to ship a directory named `foo` that resides within a `src` directory located at the root of your project, you can define the following:
10.54 
10.54 [tool.hatch.build.targets.wheel]
10.54 packages = ["src/foo"]
------
Dockerfile:21
--------------------
  20 |     WORKDIR /build
  21 | >>> RUN --mount=target=. \
  22 | >>>     --mount=type=cache,target=/root/.cache/pip \
  23 | >>>     python3 -m venv /venv/build \
  24 | >>>     && /venv/build/bin/pip install hatch \
  25 | >>>     && /venv/build/bin/hatch build -t wheel /whl
  26 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c python3 -m venv /venv/build     && /venv/build/bin/pip install hatch     && /venv/build/bin/hatch build -t wheel /whl" did not complete successfully: exit code: 1

Metadata

Metadata

Assignees

No one assigned

    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