Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build container #46

Closed
CrysK opened this issue Mar 21, 2023 · 4 comments
Closed

Can't build container #46

CrysK opened this issue Mar 21, 2023 · 4 comments

Comments

@CrysK
Copy link

CrysK commented Mar 21, 2023

I want to create a docker container with this plugin:

FROM squidfunk/mkdocs-material

RUN pip install --no-cache-dir \
  mkdocs-table-reader-plugin

ENTRYPOINT ["mkdocs"]

But when I run it, I get an error:

$ docker build -t mkdocs-material-plus_23-03-21 .
[+] Building 39.4s (5/5) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                0.0s
 => => transferring dockerfile: 247B                                                                                                                0.0s
 => [internal] load .dockerignore                                                                                                                   0.0s
 => => transferring context: 2B                                                                                                                     0.0s
 => [internal] load metadata for docker.io/squidfunk/mkdocs-material:latest                                                                         0.0s
 => CACHED [1/2] FROM docker.io/squidfunk/mkdocs-material                                                                                           0.0s
 => ERROR [2/2] RUN pip install --no-cache-dir   mkdocs-table-reader-plugin                                                                        39.3s
------
 > [2/2] RUN pip install --no-cache-dir   mkdocs-table-reader-plugin:
#0 3.040 Collecting mkdocs-table-reader-plugin
#0 3.210   Downloading mkdocs_table_reader_plugin-2.0-py3-none-any.whl (9.1 kB)
#0 3.241 Requirement already satisfied: mkdocs>=1.0 in /usr/local/lib/python3.11/site-packages (from mkdocs-table-reader-plugin) (1.4.2)
#0 3.497 Collecting pandas>=1.1
#0 3.530   Downloading pandas-1.5.3.tar.gz (5.2 MB)
#0 4.261      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.2/5.2 MB 7.2 MB/s eta 0:00:00
#0 5.335   Installing build dependencies: started
#0 38.75   Installing build dependencies: finished with status 'error'
#0 38.78   error: subprocess-exited-with-error
#0 38.78
#0 38.78   × pip subprocess to install build dependencies did not run successfully.
#0 38.78   │ exit code: 1
#0 38.78   ╰─> [305 lines of output]
#0 38.78       Collecting setuptools>=51.0.0
#0 38.78         Downloading setuptools-67.6.0-py3-none-any.whl (1.1 MB)
#0 38.78            ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 4.0 MB/s eta 0:00:00
#0 38.78       Collecting wheel
#0 38.78         Downloading wheel-0.40.0-py3-none-any.whl (64 kB)
#0 38.78            ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 64.5/64.5 kB 18.4 MB/s eta 0:00:00
#0 38.78       Collecting Cython<3,>=0.29.32
#0 38.78         Downloading Cython-0.29.33-cp311-cp311-musllinux_1_1_x86_64.whl (2.0 MB)
#0 38.78            ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 6.8 MB/s eta 0:00:00
#0 38.78       Collecting oldest-supported-numpy>=2022.8.16
#0 38.78         Downloading oldest_supported_numpy-2022.11.19-py3-none-any.whl (4.9 kB)
#0 38.78       Collecting numpy==1.23.2
#0 38.78         Downloading numpy-1.23.2.tar.gz (10.7 MB)
#0 38.78            ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.7/10.7 MB 11.6 MB/s eta 0:00:00
#0 38.78         Installing build dependencies: started
#0 38.78         Installing build dependencies: finished with status 'done'
#0 38.78         Getting requirements to build wheel: started
#0 38.78         Getting requirements to build wheel: finished with status 'done'
#0 38.78         Preparing metadata (pyproject.toml): started
#0 38.78         Preparing metadata (pyproject.toml): finished with status 'done'
#0 38.78       Building wheels for collected packages: numpy
#0 38.78         Building wheel for numpy (pyproject.toml): started
#0 38.78         Building wheel for numpy (pyproject.toml): finished with status 'error'
#0 38.78         error: subprocess-exited-with-error
#0 38.78
#0 38.78         × Building wheel for numpy (pyproject.toml) did not run successfully.
#0 38.78         │ exit code: 1
#0 38.78         ╰─> [268 lines of output]
#0 38.78             setup.py:71: RuntimeWarning: NumPy 1.23.2 may not yet support Python 3.11.
#0 38.78               warnings.warn(
#0 38.78             Running from numpy source directory.
#0 38.78             setup.py:86: DeprecationWarning:
#0 38.78
#0 38.78               `numpy.distutils` is deprecated since NumPy 1.23.0, as a result
#0 38.78               of the deprecation of `distutils` itself. It will be removed for
#0 38.78               Python >= 3.12. For older Python versions it will remain present.
#0 38.78               It is recommended to use `setuptools < 60.0` for those Python versions.
#0 38.78               For more details, see:
#0 38.78                 https://numpy.org/devdocs/reference/distutils_status_migration.html
#0 38.78
#0 38.78
#0 38.78               import numpy.distutils.command.sdist
#0 38.78             Processing numpy/random/_bounded_integers.pxd.in
#0 38.78             Processing numpy/random/_mt19937.pyx
#0 38.78             Processing numpy/random/mtrand.pyx
#0 38.78             Processing numpy/random/bit_generator.pyx
#0 38.78             Processing numpy/random/_generator.pyx
#0 38.78             Processing numpy/random/_pcg64.pyx
#0 38.78             Processing numpy/random/_common.pyx
#0 38.78             Processing numpy/random/_philox.pyx
#0 38.78             Processing numpy/random/_bounded_integers.pyx.in
#0 38.78             Processing numpy/random/_sfc64.pyx
#0 38.78             Cythonizing sources
#0 38.78             INFO: blas_opt_info:
#0 38.78             INFO: blas_armpl_info:
#0 38.78             INFO: customize UnixCCompiler
#0 38.78             INFO:   libraries armpl_lp64_mp not found in ['/usr/local/lib', '/usr/lib']
#0 38.78             INFO:   NOT AVAILABLE
#0 38.78             INFO:
#0 38.78             INFO: blas_mkl_info:
#0 38.78             INFO:   libraries mkl_rt not found in ['/usr/local/lib', '/usr/lib']
#0 38.78             INFO:   NOT AVAILABLE
#0 38.78             INFO:
#0 38.78             INFO: blis_info:
#0 38.78             INFO:   libraries blis not found in ['/usr/local/lib', '/usr/lib']
#0 38.78             INFO:   NOT AVAILABLE
#0 38.78             INFO:
#0 38.78             INFO: openblas_info:
#0 38.78             INFO:   libraries openblas not found in ['/usr/local/lib', '/usr/lib']
#0 38.78             INFO:   NOT AVAILABLE
#0 38.78             INFO:
#0 38.78             INFO: accelerate_info:
#0 38.78             INFO:   NOT AVAILABLE
#0 38.78             INFO:
#0 38.78             INFO: atlas_3_10_blas_threads_info:
#0 38.78             INFO: Setting PTATLAS=ATLAS
#0 38.78             INFO:   libraries tatlas not found in ['/usr/local/lib', '/usr/lib']
#0 38.78             INFO:   NOT AVAILABLE
#0 38.78             INFO:
#0 38.78             INFO: atlas_3_10_blas_info:
#0 38.78             INFO:   libraries satlas not found in ['/usr/local/lib', '/usr/lib']
#0 38.78             INFO:   NOT AVAILABLE
#0 38.78             INFO:
#0 38.78             INFO: atlas_blas_threads_info:
#0 38.78             INFO: Setting PTATLAS=ATLAS
#0 38.78             INFO:   libraries ptf77blas,ptcblas,atlas not found in ['/usr/local/lib', '/usr/lib']
#0 38.78             INFO:   NOT AVAILABLE
#0 38.78             INFO:
#0 38.78             INFO: atlas_blas_info:
#0 38.78             INFO:   libraries f77blas,cblas,atlas not found in ['/usr/local/lib', '/usr/lib']
#0 38.78             INFO:   NOT AVAILABLE
#0 38.78             INFO:
#0 38.78             /tmp/pip-install-ezaovveg/numpy_c310a90dc71e4314bbfb352ad82a11b0/numpy/distutils/system_info.py:2077: UserWarning:
#0 38.78                 Optimized (vendor) Blas libraries are not found.
#0 38.78                 Falls back to netlib Blas library which has worse performance.
#0 38.78                 A better performance should be easily gained by switching
#0 38.78                 Blas library.
#0 38.78               if self._calc_info(blas):
#0 38.78             INFO: blas_info:
#0 38.78             INFO:   libraries blas not found in ['/usr/local/lib', '/usr/lib']
#0 38.78             INFO:   NOT AVAILABLE
#0 38.78             INFO:
#0 38.78             /tmp/pip-install-ezaovveg/numpy_c310a90dc71e4314bbfb352ad82a11b0/numpy/distutils/system_info.py:2077: UserWarning:
#0 38.78                 Blas (http://www.netlib.org/blas/) libraries not found.
#0 38.78                 Directories to search for the libraries can be specified in the
#0 38.78                 numpy/distutils/site.cfg file (section [blas]) or by setting
#0 38.78                 the BLAS environment variable.
#0 38.78               if self._calc_info(blas):
#0 38.78             INFO: blas_src_info:
#0 38.78             INFO:   NOT AVAILABLE
#0 38.78             INFO:
#0 38.78             /tmp/pip-install-ezaovveg/numpy_c310a90dc71e4314bbfb352ad82a11b0/numpy/distutils/system_info.py:2077: UserWarning:
#0 38.78                 Blas (http://www.netlib.org/blas/) sources not found.
#0 38.78                 Directories to search for the sources can be specified in the
#0 38.78                 numpy/distutils/site.cfg file (section [blas_src]) or by setting
#0 38.78                 the BLAS_SRC environment variable.
#0 38.78               if self._calc_info(blas):
#0 38.78             INFO:   NOT AVAILABLE
#0 38.78             INFO:
#0 38.78             non-existing path in 'numpy/distutils': 'site.cfg'
#0 38.78             INFO: lapack_opt_info:
#0 38.78             INFO: lapack_armpl_info:
#0 38.78             INFO:   libraries armpl_lp64_mp not found in ['/usr/local/lib', '/usr/lib']
#0 38.78             INFO:   NOT AVAILABLE
#0 38.78             INFO:
#0 38.78             INFO: lapack_mkl_info:
#0 38.78             INFO:   libraries mkl_rt not found in ['/usr/local/lib', '/usr/lib']
#0 38.78             INFO:   NOT AVAILABLE
#0 38.78             INFO:
#0 38.78             INFO: openblas_lapack_info:
#0 38.78             INFO:   libraries openblas not found in ['/usr/local/lib', '/usr/lib']
#0 38.78             INFO:   NOT AVAILABLE
#0 38.78             INFO:
#0 38.78             INFO: openblas_clapack_info:
#0 38.78             INFO:   libraries openblas,lapack not found in ['/usr/local/lib', '/usr/lib']
#0 38.78             INFO:   NOT AVAILABLE
#0 38.78             INFO:
#0 38.78             INFO: flame_info:
#0 38.78             INFO:   libraries flame not found in ['/usr/local/lib', '/usr/lib']
#0 38.78             INFO:   NOT AVAILABLE
#0 38.78             INFO:
#0 38.78             INFO: atlas_3_10_threads_info:
#0 38.78             INFO: Setting PTATLAS=ATLAS
#0 38.78             INFO:   libraries tatlas,tatlas not found in /usr/local/lib
#0 38.78             INFO:   libraries tatlas,tatlas not found in /usr/lib
#0 38.78             INFO: <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
#0 38.78             INFO:   NOT AVAILABLE
#0 38.78             INFO:
#0 38.78             INFO: atlas_3_10_info:
#0 38.78             INFO:   libraries satlas,satlas not found in /usr/local/lib
#0 38.78             INFO:   libraries satlas,satlas not found in /usr/lib
#0 38.78             INFO: <class 'numpy.distutils.system_info.atlas_3_10_info'>
#0 38.78             INFO:   NOT AVAILABLE
#0 38.78             INFO:
#0 38.78             INFO: atlas_threads_info:
#0 38.78             INFO: Setting PTATLAS=ATLAS
#0 38.78             INFO:   libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
#0 38.78             INFO:   libraries ptf77blas,ptcblas,atlas not found in /usr/lib
#0 38.78             INFO: <class 'numpy.distutils.system_info.atlas_threads_info'>
#0 38.78             INFO:   NOT AVAILABLE
#0 38.78             INFO:
#0 38.78             INFO: atlas_info:
#0 38.78             INFO:   libraries f77blas,cblas,atlas not found in /usr/local/lib
#0 38.78             INFO:   libraries f77blas,cblas,atlas not found in /usr/lib
#0 38.78             INFO: <class 'numpy.distutils.system_info.atlas_info'>
#0 38.78             INFO:   NOT AVAILABLE
#0 38.78             INFO:
#0 38.78             INFO: lapack_info:
#0 38.78             INFO:   libraries lapack not found in ['/usr/local/lib', '/usr/lib']
#0 38.78             INFO:   NOT AVAILABLE
#0 38.78             INFO:
#0 38.78             /tmp/pip-install-ezaovveg/numpy_c310a90dc71e4314bbfb352ad82a11b0/numpy/distutils/system_info.py:1902: UserWarning:
#0 38.78                 Lapack (http://www.netlib.org/lapack/) libraries not found.
#0 38.78                 Directories to search for the libraries can be specified in the
#0 38.78                 numpy/distutils/site.cfg file (section [lapack]) or by setting
#0 38.78                 the LAPACK environment variable.
#0 38.78               return getattr(self, '_calc_info_{}'.format(name))()
#0 38.78             INFO: lapack_src_info:
#0 38.78             INFO:   NOT AVAILABLE
#0 38.78             INFO:
#0 38.78             /tmp/pip-install-ezaovveg/numpy_c310a90dc71e4314bbfb352ad82a11b0/numpy/distutils/system_info.py:1902: UserWarning:
#0 38.78                 Lapack (http://www.netlib.org/lapack/) sources not found.
#0 38.78                 Directories to search for the sources can be specified in the
#0 38.78                 numpy/distutils/site.cfg file (section [lapack_src]) or by setting
#0 38.78                 the LAPACK_SRC environment variable.
#0 38.78               return getattr(self, '_calc_info_{}'.format(name))()
#0 38.78             INFO:   NOT AVAILABLE
#0 38.78             INFO:
#0 38.78             INFO: numpy_linalg_lapack_lite:
#0 38.78             INFO:   FOUND:
#0 38.78             INFO:     language = c
#0 38.78             INFO:     define_macros = [('HAVE_BLAS_ILP64', None), ('BLAS_SYMBOL_SUFFIX', '64_')]
#0 38.78             INFO:
#0 38.78             Warning: attempted relative import with no known parent package
#0 38.78             /tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py:275: UserWarning: Unknown distribution option: 'define_macros'
#0 38.78               warnings.warn(msg)
#0 38.78             running bdist_wheel
#0 38.78             running build
#0 38.78             running config_cc
#0 38.78             INFO: unifing config_cc, config, build_clib, build_ext, build commands --compiler options
#0 38.78             running config_fc
#0 38.78             INFO: unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
#0 38.78             running build_src
#0 38.78             INFO: build_src
#0 38.78             INFO: building py_modules sources
#0 38.78             creating build
#0 38.78             creating build/src.linux-x86_64-3.11
#0 38.78             creating build/src.linux-x86_64-3.11/numpy
#0 38.78             creating build/src.linux-x86_64-3.11/numpy/distutils
#0 38.78             INFO: building library "npymath" sources
#0 38.78             WARN: Could not locate executable armflang
#0 38.78             WARN: Could not locate executable gfortran
#0 38.78             WARN: Could not locate executable f95
#0 38.78             WARN: Could not locate executable ifort
#0 38.78             WARN: Could not locate executable ifc
#0 38.78             WARN: Could not locate executable lf95
#0 38.78             WARN: Could not locate executable pgfortran
#0 38.78             WARN: Could not locate executable nvfortran
#0 38.78             WARN: Could not locate executable f90
#0 38.78             WARN: Could not locate executable f77
#0 38.78             WARN: Could not locate executable fort
#0 38.78             WARN: Could not locate executable efort
#0 38.78             WARN: Could not locate executable efc
#0 38.78             WARN: Could not locate executable g77
#0 38.78             WARN: Could not locate executable g95
#0 38.78             WARN: Could not locate executable pathf95
#0 38.78             WARN: Could not locate executable nagfor
#0 38.78             WARN: Could not locate executable frt
#0 38.78             WARN: don't know how to compile Fortran code on platform 'posix'
#0 38.78
#0 38.78
#0 38.78             [Errno 2] No such file or directory: 'gcc'
#0 38.78
#0 38.78
#0 38.78             Traceback (most recent call last):
#0 38.78               File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 351, in <module>
#0 38.78                 main()
#0 38.78               File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 333, in main
#0 38.78                 json_out['return_val'] = hook(**hook_input['kwargs'])
#0 38.78                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#0 38.78               File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 249, in build_wheel
#0 38.78                 return _build_backend().build_wheel(wheel_directory, config_settings,
#0 38.78                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#0 38.78               File "/tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 230, in build_wheel
#0 38.78                 return self._build_with_temp_dir(['bdist_wheel'], '.whl',
#0 38.78                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#0 38.78               File "/tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 215, in _build_with_temp_dir
#0 38.78                 self.run_setup()
#0 38.78               File "/tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 268, in run_setup
#0 38.78                 self).run_setup(setup_script=setup_script)
#0 38.78                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#0 38.78               File "/tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 158, in run_setup
#0 38.78                 exec(compile(code, __file__, 'exec'), locals())
#0 38.78               File "setup.py", line 493, in <module>
#0 38.78                 setup_package()
#0 38.78               File "setup.py", line 485, in setup_package
#0 38.78                 setup(**metadata)
#0 38.78               File "/tmp/pip-install-ezaovveg/numpy_c310a90dc71e4314bbfb352ad82a11b0/numpy/distutils/core.py", line 169, in setup
#0 38.78                 return old_setup(**new_attr)
#0 38.78                        ^^^^^^^^^^^^^^^^^^^^^
#0 38.78               File "/tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 153, in setup
#0 38.78                 return distutils.core.setup(**attrs)
#0 38.78                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#0 38.78               File "/tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 148, in setup
#0 38.78                 dist.run_commands()
#0 38.78               File "/tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
#0 38.78                 self.run_command(cmd)
#0 38.78               File "/tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
#0 38.78                 cmd_obj.run()
#0 38.78               File "/tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/wheel/bdist_wheel.py", line 299, in run
#0 38.78                 self.run_command('build')
#0 38.78               File "/tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
#0 38.78                 self.distribution.run_command(command)
#0 38.78               File "/tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
#0 38.78                 cmd_obj.run()
#0 38.78               File "/tmp/pip-install-ezaovveg/numpy_c310a90dc71e4314bbfb352ad82a11b0/numpy/distutils/command/build.py", line 62, in run
#0 38.78                 old_build.run(self)
#0 38.78               File "/tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 135, in run
#0 38.78                 self.run_command(cmd_name)
#0 38.78               File "/tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
#0 38.78                 self.distribution.run_command(command)
#0 38.78               File "/tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
#0 38.78                 cmd_obj.run()
#0 38.78               File "/tmp/pip-install-ezaovveg/numpy_c310a90dc71e4314bbfb352ad82a11b0/numpy/distutils/command/build_src.py", line 144, in run
#0 38.78                 self.build_sources()
#0 38.78               File "/tmp/pip-install-ezaovveg/numpy_c310a90dc71e4314bbfb352ad82a11b0/numpy/distutils/command/build_src.py", line 155, in build_sources
#0 38.78                 self.build_library_sources(*libname_info)
#0 38.78               File "/tmp/pip-install-ezaovveg/numpy_c310a90dc71e4314bbfb352ad82a11b0/numpy/distutils/command/build_src.py", line 288, in build_library_sources
#0 38.78                 sources = self.generate_sources(sources, (lib_name, build_info))
#0 38.78                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#0 38.78               File "/tmp/pip-install-ezaovveg/numpy_c310a90dc71e4314bbfb352ad82a11b0/numpy/distutils/command/build_src.py", line 378, in generate_sources
#0 38.78                 source = func(extension, build_dir)
#0 38.78                          ^^^^^^^^^^^^^^^^^^^^^^^^^^
#0 38.78               File "/tmp/pip-install-ezaovveg/numpy_c310a90dc71e4314bbfb352ad82a11b0/numpy/core/setup.py", line 758, in get_mathlib_info
#0 38.78                 raise RuntimeError(
#0 38.78             RuntimeError: Broken toolchain: cannot link a simple C program.
#0 38.78             [end of output]
#0 38.78
#0 38.78         note: This error originates from a subprocess, and is likely not a problem with pip.
#0 38.78         ERROR: Failed building wheel for numpy
#0 38.78       Failed to build numpy
#0 38.78       ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
#0 38.78
#0 38.78       [notice] A new release of pip available: 22.3 -> 23.0.1
#0 38.78       [notice] To update, run: pip install --upgrade pip
#0 38.78       [end of output]
#0 38.78
#0 38.78   note: This error originates from a subprocess, and is likely not a problem with pip.
#0 38.79 error: subprocess-exited-with-error
#0 38.79
#0 38.79 × pip subprocess to install build dependencies did not run successfully.
#0 38.79 │ exit code: 1
#0 38.79 ╰─> See above for output.
#0 38.79
#0 38.79 note: This error originates from a subprocess, and is likely not a problem with pip.
#0 39.11
#0 39.11 [notice] A new release of pip available: 22.3 -> 23.0.1
#0 39.11 [notice] To update, run: pip install --upgrade pip
------
Dockerfile:6
--------------------
   5 |
   6 | >>> RUN pip install --no-cache-dir \
   7 | >>>   mkdocs-table-reader-plugin
   8 |
--------------------
ERROR: failed to solve: process "/bin/sh -c pip install --no-cache-dir   mkdocs-table-reader-plugin" did not complete successfully: exit code: 1

I can add any other mkdocs plugin, only the table-reader plugin does not work

@karl-johan-grahn
Copy link

squidfunk/mkdocs-material is based on Alpine images which doesn't support Pandas and NumPy https://github.com/squidfunk/mkdocs-material/blob/master/Dockerfile

@timvink
Copy link
Owner

timvink commented Mar 23, 2023

Exactly, this package depends on pandas, which depends on numpy, which needs to build C++ to install.

Either adapt the Alpine image (see for example https://stackoverflow.com/questions/33421965/installing-numpy-on-docker-alpine), or if image size is not an issue use a more complete docker image like python-slim.

I'll leave this issue open, as the documentation could be improved. It's a fairly common issue with docker images.

@CrysK
Copy link
Author

CrysK commented Apr 29, 2023

Using this as a reference: https://github.com/squidfunk/mkdocs-material/blob/master/Dockerfile
I wrote a small tutorial on a Dockerfile where anyone can add all sorts of add-ins, including of course mkdocs-table-reader-plugin ;)


  • create file Dockerfile
FROM python:3-slim

# Build-time flags
ARG WITH_PLUGINS=true

# Environment variables
ENV PACKAGES=/usr/local/lib/python3.11/site-packages
ENV PYTHONDONTWRITEBYTECODE=1

# Set build directory
WORKDIR /tmp

# Copy files necessary for build
COPY material-git/material material
COPY material-git/package.json package.json
COPY material-git/README.md README.md
COPY material-git/requirements.txt requirements.txt
COPY material-git/pyproject.toml pyproject.toml

# Perform build and cleanup artifacts and caches
RUN \
  apt update \
&& \
  apt install -y \
    libcairo2-dev \
    libfreetype6-dev \
    git \
    libturbojpeg-dev \
    openssh-server \
    zlib1g-dev \
&& \
  apt install -y \
    gcc \
    libffi-dev \
    musl-dev \
&& \
  pip install --no-cache-dir . \
&& \
  if [ "${WITH_PLUGINS}" = "true" ]; then \
    pip install --no-cache-dir \
      "mkdocs-minify-plugin>=0.3" \
      "mkdocs-redirects>=1.0" \
      "pillow>=9.0" \
      "cairosvg>=2.5" \
      "mkdocs-awesome-pages-plugin" \
      "mkdocs-git-revision-date-localized-plugin" \
      "mkdocs-bibtex" \
      "mkdocs-img2fig-plugin" \
      "mkdocs-mermaid2-plugin" \
      "mkdocs-include-markdown-plugin" \
      "mkdocs-encryptcontent-plugin" \
      "mkdocs-enumerate-headings-plugin" \
      "mkdocs-literate-nav" \
      "mkdocs-section-index" \
      "mkdocs-table-reader-plugin" \
      "mkdocs-macros-plugin" \
      ; \
  fi \
&& \
  for theme in mkdocs readthedocs; do \
    rm -rf ${PACKAGES}/mkdocs/themes/$theme; \
    ln -s \
      ${PACKAGES}/material \
      ${PACKAGES}/mkdocs/themes/$theme; \
  done \
&& \
  rm -rf /tmp/* /root/.cache \
&& \
  find ${PACKAGES} \
    -type f \
    -path "*/__pycache__/*" \
    -exec rm -f {} \;

# Trust directory, required for git >= 2.35.2
RUN git config --global --add safe.directory /docs &&\
    git config --global --add safe.directory /site

# Set working directory
WORKDIR /docs

# Expose MkDocs development server port
EXPOSE 8000

# Start development server by default
ENTRYPOINT ["mkdocs"]
CMD ["serve", "--dev-addr=0.0.0.0:8000"]
  • Starting from line 46 simply add or remove add-ins
  • Run in the same directory: git clone https://github.com/squidfunk/mkdocs-material.git material-git/
  • Finally, run to create container: docker build -t YOUR-CONTAINER-NAME .
  • Use the created container as usual

Tested with: Ubuntu 22 LTS, Docker 23 (as Host); Material v9.1.8


@timvink if you find it useful, feel free to add it to the README

@timvink
Copy link
Owner

timvink commented May 22, 2023

Thanks @CrysK ! I will add it to the how-to guides next time I work on this plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants