Docker Compose build fails using python alpine image
lwebb-dev opened this issue · 0 comments
lwebb-dev commented
Running docker-compose up --build
results in an error during poetry install
.
My guess is that the alpine image is missing essential build tools like gcc
. Swapping this image out for python:3-bullseye
results in a successful build, at the cost of a larger container size.
[+] Building 40.6s (9/9) FINISHED
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 463B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 66B 0.0s
=> [internal] load metadata for docker.io/library/python:3-alpine 2.6s
=> [1/5] FROM docker.io/library/python:3-alpine@sha256:ba6cfcca463537621aac63ffda4f93cd73e1f3dea59a83287603fbebd 2.9s
=> => resolve docker.io/library/python:3-alpine@sha256:ba6cfcca463537621aac63ffda4f93cd73e1f3dea59a83287603fbebd 0.0s
=> => sha256:530afca65e2ea04227630ae746e0c85b2bd1a179379cbf2b6501b49c4cab2ccc 2.80MB / 2.80MB 0.4s
=> => sha256:ba6cfcca463537621aac63ffda4f93cd73e1f3dea59a83287603fbebd02444e4 1.65kB / 1.65kB 0.0s
=> => sha256:fc633a94d6239c161ead1fd3a192b5853e5807da6239f1ac9cf20c31391af3ab 1.37kB / 1.37kB 0.0s
=> => sha256:eb1dfcc4f9e9884135653d74000b3a174fd77cc76a557601e9b763a064ba67ef 7.04kB / 7.04kB 0.0s
=> => sha256:cc8c14b1a767335de44f2bc926cb52487979a0fe602ac5429643dbb238f297fb 666.77kB / 666.77kB 0.5s
=> => sha256:bd99fa58365b603cbeb71c93c19182410b640606f36158c10d7ee09d63c1a4f6 12.18MB / 12.18MB 1.3s
=> => extracting sha256:530afca65e2ea04227630ae746e0c85b2bd1a179379cbf2b6501b49c4cab2ccc 0.5s
=> => sha256:777a82aef5431a7852c25deef1cc9e479a3be2c2a9f49e41306b9da78184f1ef 231B / 231B 0.6s
=> => sha256:1ef14832cf3c6d891726d458ea44fb7be8662b778048035236efe234a7c2699f 2.87MB / 2.87MB 1.1s
=> => extracting sha256:cc8c14b1a767335de44f2bc926cb52487979a0fe602ac5429643dbb238f297fb 0.4s
=> => extracting sha256:bd99fa58365b603cbeb71c93c19182410b640606f36158c10d7ee09d63c1a4f6 0.5s
=> => extracting sha256:777a82aef5431a7852c25deef1cc9e479a3be2c2a9f49e41306b9da78184f1ef 0.0s
=> => extracting sha256:1ef14832cf3c6d891726d458ea44fb7be8662b778048035236efe234a7c2699f 0.3s
=> [internal] load build context 1.6s
=> => transferring context: 59.06MB 1.5s
=> [2/5] RUN pip install poetry 18.0s
=> [3/5] ADD . /ditto 0.2s
=> [4/5] WORKDIR /ditto 0.1s
=> ERROR [5/5] RUN poetry install 16.5s
------
> [5/5] RUN poetry install:
#0 1.441 Creating virtualenv pokeapi-ditto-FLGrt-Xt-py3.10 in /root/.cache/pypoetry/virtualenvs
#0 2.508 Installing dependencies from lock file
#0 2.924
#0 2.924 Package operations: 27 installs, 0 updates, 0 removals
#0 2.924
#0 2.926 • Installing appdirs (1.4.3)
#0 2.928 • Installing atomicwrites (1.4.0)
#0 2.928 • Installing attrs (19.3.0)
#0 2.931 • Installing certifi (2020.4.5.1)
#0 2.937 • Installing chardet (3.0.4)
#0 2.942 • Installing click (7.1.2)
#0 2.947 • Installing entrypoints (0.3)
#0 2.950 • Installing idna (2.9)
#0 2.955 • Installing mccabe (0.6.1)
#0 2.957 • Installing multidict (4.7.5)
#0 2.961 • Installing more-itertools (8.2.0)
#0 2.967 • Installing pluggy (0.13.1)
#0 7.981 • Installing py (1.8.1)
#0 8.028 • Installing pycodestyle (2.5.0)
#0 8.084 • Installing pyflakes (2.1.1)
#0 8.123 • Installing six (1.14.0)
#0 8.137 • Installing toml (0.10.0)
#0 8.142 • Installing urllib3 (1.25.9)
#0 16.25
#0 16.25 EnvCommandError
#0 16.25
#0 16.25 Command ['/root/.cache/pypoetry/virtualenvs/pokeapi-ditto-FLGrt-Xt-py3.10/bin/pip', 'install', '--no-deps', '/root/.cache/pypoetry/artifacts/bf/d3/e2/eaa2fd0d0109e16c0a1c14ddd0619083d61bc4d6b33076433fab541d97/multidict-4.7.5.tar.gz'] errored with the following return code 1, and output:
#0 16.25 Processing /root/.cache/pypoetry/artifacts/bf/d3/e2/eaa2fd0d0109e16c0a1c14ddd0619083d61bc4d6b33076433fab541d97/multidict-4.7.5.tar.gz
#0 16.25 Installing build dependencies: started
#0 16.25 Installing build dependencies: finished with status 'done'
#0 16.25 Getting requirements to build wheel: started
#0 16.25 Getting requirements to build wheel: finished with status 'done'
#0 16.25 Preparing metadata (pyproject.toml): started
#0 16.25 Preparing metadata (pyproject.toml): finished with status 'done'
#0 16.25 Building wheels for collected packages: multidict
#0 16.25 Building wheel for multidict (pyproject.toml): started
#0 16.25 Building wheel for multidict (pyproject.toml): finished with status 'error'
#0 16.25 error: subprocess-exited-with-error
#0 16.25
#0 16.25 × Building wheel for multidict (pyproject.toml) did not run successfully.
#0 16.25 │ exit code: 1
#0 16.25 ╰─> [72 lines of output]
#0 16.25 /tmp/pip-build-env-8_0t84dp/overlay/lib/python3.10/site-packages/setuptools/config/setupcfg.py:463: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
#0 16.25 warnings.warn(msg, warning_class)
#0 16.25 **********************
#0 16.25 * Accellerated build *
#0 16.25 **********************
#0 16.25 running bdist_wheel
#0 16.25 running build
#0 16.25 running build_py
#0 16.25 creating build
#0 16.25 creating build/lib.linux-x86_64-cpython-310
#0 16.25 creating build/lib.linux-x86_64-cpython-310/multidict
#0 16.25 copying multidict/_multidict_py.py -> build/lib.linux-x86_64-cpython-310/multidict
#0 16.25 copying multidict/_abc.py -> build/lib.linux-x86_64-cpython-310/multidict
#0 16.25 copying multidict/_multidict_base.py -> build/lib.linux-x86_64-cpython-310/multidict
#0 16.25 copying multidict/_compat.py -> build/lib.linux-x86_64-cpython-310/multidict
#0 16.25 copying multidict/__init__.py -> build/lib.linux-x86_64-cpython-310/multidict
#0 16.25 running egg_info
#0 16.25 writing multidict.egg-info/PKG-INFO
#0 16.25 writing dependency_links to multidict.egg-info/dependency_links.txt
#0 16.25 writing top-level names to multidict.egg-info/top_level.txt
#0 16.25 reading manifest file 'multidict.egg-info/SOURCES.txt'
#0 16.25 reading manifest template 'MANIFEST.in'
#0 16.25 warning: no previously-included files matching '*.pyc' found anywhere in distribution
#0 16.25 warning: no previously-included files found matching 'multidict/_multidict.html'
#0 16.25 warning: no previously-included files found matching 'multidict/*.so'
#0 16.25 warning: no previously-included files found matching 'multidict/*.pyd'
#0 16.25 warning: no previously-included files found matching 'multidict/*.pyd'
#0 16.25 no previously-included directories found matching 'docs/_build'
#0 16.25 adding license file 'LICENSE'
#0 16.25 writing manifest file 'multidict.egg-info/SOURCES.txt'
#0 16.25 /tmp/pip-build-env-8_0t84dp/overlay/lib/python3.10/site-packages/setuptools/command/build_py.py:153: SetuptoolsDeprecationWarning: Installing 'multidict._multilib' as data is deprecated, please list it in `packages`.
#0 16.25 !!
#0 16.25
#0 16.25
#0 16.25 ############################
#0 16.25 # Package would be ignored #
#0 16.25 ############################
#0 16.25 Python recognizes 'multidict._multilib' as an importable package,
#0 16.25 but it is not listed in the `packages` configuration of setuptools.
#0 16.25
#0 16.25 'multidict._multilib' has been automatically added to the distribution only
#0 16.25 because it may contain data files, but this behavior is likely to change
#0 16.25 in future versions of setuptools (and therefore is considered deprecated).
#0 16.25
#0 16.25 Please make sure that 'multidict._multilib' is included as a package by using
#0 16.25 the `packages` configuration field or the proper discovery methods
#0 16.25 (for example by using `find_namespace_packages(...)`/`find_namespace:`
#0 16.25 instead of `find_packages(...)`/`find:`).
#0 16.25
#0 16.25 You can read more about "package discovery" and "data files" on setuptools
#0 16.25 documentation page.
#0 16.25
#0 16.25
#0 16.25 !!
#0 16.25
#0 16.25 check.warn(importable)
#0 16.25 copying multidict/__init__.pyi -> build/lib.linux-x86_64-cpython-310/multidict
#0 16.25 copying multidict/_multidict.c -> build/lib.linux-x86_64-cpython-310/multidict
#0 16.25 copying multidict/py.typed -> build/lib.linux-x86_64-cpython-310/multidict
#0 16.25 creating build/lib.linux-x86_64-cpython-310/multidict/_multilib
#0 16.25 copying multidict/_multilib/defs.h -> build/lib.linux-x86_64-cpython-310/multidict/_multilib
#0 16.25 copying multidict/_multilib/dict.h -> build/lib.linux-x86_64-cpython-310/multidict/_multilib
#0 16.25 copying multidict/_multilib/istr.h -> build/lib.linux-x86_64-cpython-310/multidict/_multilib
#0 16.25 copying multidict/_multilib/iter.h -> build/lib.linux-x86_64-cpython-310/multidict/_multilib
#0 16.25 copying multidict/_multilib/pair_list.h -> build/lib.linux-x86_64-cpython-310/multidict/_multilib
#0 16.25 copying multidict/_multilib/views.h -> build/lib.linux-x86_64-cpython-310/multidict/_multilib
#0 16.25 running build_ext
#0 16.25 building 'multidict._multidict' extension
#0 16.25 creating build/temp.linux-x86_64-cpython-310
#0 16.25 creating build/temp.linux-x86_64-cpython-310/multidict
#0 16.25 gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/root/.cache/pypoetry/virtualenvs/pokeapi-ditto-FLGrt-Xt-py3.10/include -I/usr/local/include/python3.10 -c multidict/_multidict.c -o build/temp.linux-x86_64-cpython-310/multidict/_multidict.o -O2 -std=c99 -Wall -Wsign-compare -Wconversion -fno-strict-aliasing -pedantic
#0 16.25 error: command 'gcc' failed: No such file or directory
#0 16.25 [end of output]
#0 16.25
#0 16.25 note: This error originates from a subprocess, and is likely not a problem with pip.
#0 16.25 ERROR: Failed building wheel for multidict
#0 16.25 Failed to build multidict
#0 16.25 ERROR: Could not build wheels for multidict, which is required to install pyproject.toml-based projects
#0 16.25
#0 16.25 [notice] A new release of pip available: 22.1.2 -> 22.2
#0 16.25 [notice] To update, run: pip install --upgrade pip
#0 16.25
#0 16.25
#0 16.25 at /usr/local/lib/python3.10/site-packages/poetry/utils/env.py:1195 in _run
#0 16.34 1191│ output = subprocess.check_output(
#0 16.34 1192│ cmd, stderr=subprocess.STDOUT, **kwargs
#0 16.34 1193│ )
#0 16.34 1194│ except CalledProcessError as e:
#0 16.34 → 1195│ raise EnvCommandError(e, input=input_)
#0 16.34 1196│
#0 16.34 1197│ return decode(output)
#0 16.34 1198│
#0 16.34 1199│ def execute(self, bin, *args, **kwargs):
#0 16.34
------
failed to solve: executor failed running [/bin/sh -c poetry install]: exit code: 1