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

Cannot install python3-saml due to xmlsec in Docker #382

Closed
TheDataDexter opened this issue Oct 9, 2023 · 1 comment
Closed

Cannot install python3-saml due to xmlsec in Docker #382

TheDataDexter opened this issue Oct 9, 2023 · 1 comment

Comments

@TheDataDexter
Copy link

Hi there,

Running into a problem when building a Dockerfile. It seems to have to do with the underlying package xmlsec. I've tried several versions and still running into the problem

Similar issue to: #318

Build command:

ARG PYTHON_VERSION=3.10-slim-bullseye

# define an alias for the specfic python version used in this file.
FROM --platform=linux/amd64 python:${PYTHON_VERSION} as python
RUN apt-get update && apt-get install --no-install-recommends -y \
  libxmlsec1 libxmlsec1-dev libxml2 pkg-config

# Install pipenv
RUN pip install -U pip
RUN pip install xmlsec==1.3.13
# Python build stage
FROM python as python-build-stage

# Install apt packages
RUN apt-get update && apt-get install --no-install-recommends -y \
  # dependencies for building Python packages
  build-essential \
  # psycopg2 dependencies
  libpq-dev \
  # Translations dependencies
  gettext

# Requirements are installed here to ensure they will be cached.
COPY ./requirements .

# Create Python Dependency and Sub-Dependency Wheels.
RUN pip wheel --wheel-dir /usr/src/app/wheels --verbose \
  -r dev.txt

Error trace:

Building wheel for xmlsec (pyproject.toml): started
   Building wheel for xmlsec (pyproject.toml): finished with status 'error'
   error: subprocess-exited-with-error
   
   × Building wheel for xmlsec (pyproject.toml) did not run successfully.
   │ exit code: 1
   ╰─> [21 lines of output]
       WARNING setuptools_scm.pyproject_reading toml section missing 'pyproject.toml does not contain a tool.setuptools_scm section'
       running bdist_wheel
       running build
       running build_py
       creating build
       creating build/lib.linux-x86_64-cpython-310
       creating build/lib.linux-x86_64-cpython-310/xmlsec
       copying src/xmlsec/py.typed -> build/lib.linux-x86_64-cpython-310/xmlsec
       copying src/xmlsec/constants.pyi -> build/lib.linux-x86_64-cpython-310/xmlsec
       copying src/xmlsec/template.pyi -> build/lib.linux-x86_64-cpython-310/xmlsec
       copying src/xmlsec/__init__.pyi -> build/lib.linux-x86_64-cpython-310/xmlsec
       copying src/xmlsec/tree.pyi -> build/lib.linux-x86_64-cpython-310/xmlsec
       running build_ext
       building 'xmlsec' extension
       creating build/temp.linux-x86_64-cpython-310
       creating build/temp.linux-x86_64-cpython-310/tmp
       creating build/temp.linux-x86_64-cpython-310/tmp/pip-install-173l7zot
@developer992
Copy link

developer992 commented Nov 29, 2023

try this:

apt install build-essential pkg-config libxml2-dev libxmlsec1-dev libxmlsec1-openssl libpython3.11-dev

Change libpython3.11-dev to whatever version of python you are using.

also, you need to install it, before installing xmlsec ... move it above this line
RUN pip install xmlsec==1.3.13
first install apt packages, then pip

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

2 participants