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

How install the requirements for odoo 17 in offical Docker #479

Open
MyKeySoftMK opened this issue Nov 14, 2023 · 1 comment
Open

How install the requirements for odoo 17 in offical Docker #479

MyKeySoftMK opened this issue Nov 14, 2023 · 1 comment

Comments

@MyKeySoftMK
Copy link

MyKeySoftMK commented Nov 14, 2023

Here my Docker-File:

#Source: https://github.com/odoo/docker/blob/master/17.0/Dockerfile
FROM ubuntu:jammy

ENV LANG C.UTF-8
WORKDIR /home/odoo/addons

# Retrieve the target architecture to install the correct wkhtmltopdf package
ARG TARGETARCH

# Install dependencies
RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive \
    apt-get install -y --no-install-recommends \
        ca-certificates \
        curl \
        dirmngr \
        fonts-noto-cjk \
        gnupg \
        libssl-dev \
        node-less \
        npm \
        python3-magic \
        python3-num2words \
        python3-odf \
        python3-pdfminer \
        python3-pip \
        python3-phonenumbers \
        python3-pyldap \
        python3-qrcode \
        python3-renderpm \
        python3-setuptools \
        python3-slugify \
        python3-vobject \
        python3-watchdog \
        python3-xlrd \
        python3-xlwt \
        xz-utils && \
    if [ -z "${TARGETARCH}" ]; then \
        TARGETARCH="$(dpkg --print-architecture)"; \
    fi; \
    WKHTMLTOPDF_ARCH=${TARGETARCH} && \
    case ${TARGETARCH} in \
    "amd64") WKHTMLTOPDF_ARCH=amd64 && WKHTMLTOPDF_SHA=967390a759707337b46d1c02452e2bb6b2dc6d59  ;; \
    "arm64")  WKHTMLTOPDF_SHA=90f6e69896d51ef77339d3f3a20f8582bdf496cc  ;; \
    "ppc64le" | "ppc64el") WKHTMLTOPDF_ARCH=ppc64el && WKHTMLTOPDF_SHA=5312d7d34a25b321282929df82e3574319aed25c  ;; \
    esac \
    && curl -o wkhtmltox.deb -sSL https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.jammy_${WKHTMLTOPDF_ARCH}.deb \
    && echo ${WKHTMLTOPDF_SHA} wkhtmltox.deb | sha1sum -c - \
    && apt-get install -y --no-install-recommends ./wkhtmltox.deb \
    && rm -rf /var/lib/apt/lists/* wkhtmltox.deb

# install latest postgresql-client
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ jammy-pgdg main' > /etc/apt/sources.list.d/pgdg.list \
    && GNUPGHOME="$(mktemp -d)" \
    && export GNUPGHOME \
    && repokey='B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8' \
    && gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "${repokey}" \
    && gpg --batch --armor --export "${repokey}" > /etc/apt/trusted.gpg.d/pgdg.gpg.asc \
    && gpgconf --kill all \
    && rm -rf "$GNUPGHOME" \
    && apt-get update  \
    && apt-get install --no-install-recommends -y postgresql-client \
    && rm -f /etc/apt/sources.list.d/pgdg.list \
    && rm -rf /var/lib/apt/lists/*

# Install Company Certificates
COPY ./certs/*.crt /usr/local/share/ca-certificates/
RUN update-ca-certificates 
#RUN awk -v cmd='openssl x509 -noout -subject' ' /BEGIN/{close(cmd)};{print | cmd}' < /etc/ssl/certs/ca-certificates.crt && sleep 10

# Install odoo python dependencies
RUN pip3 install setuptools wheel

RUN curl https://raw.githubusercontent.com/odoo/odoo/17.0/requirements.txt --output ./requirements.txt
RUN pip3 install -r requirements.txt && rm requirements.txt

# Install left-to-right interface for languages
RUN npm install -g rtlcss

# Clone git repositories
# RUN git clone https://github.com/odoo/odoo.git ./odoo
# Clone enterprise repository (requires enterprise account)
# RUN git clone https://user:[email protected]/odoo/enterprise.git ./enterprise

# Copy configuration file
COPY ./config/odoo.conf /etc/odoo/odoo.conf

# Run odoo
CMD ["/home/odoo/addons/odoo/odoo-bin", "-c/etc/odoo/odoo.conf"]

But when I run the install of the requirements (see the lines in my docker file with the requirement.txt), i have following error:

5.877 Collecting gevent==21.8.0
5.900   Downloading gevent-21.8.0.tar.gz (6.2 MB)
6.198      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.2/6.2 MB 21.4 MB/s eta 0:00:00
9.313   Installing build dependencies: started
23.73   Installing build dependencies: finished with status 'done'
23.74   Getting requirements to build wheel: started
37.50   Getting requirements to build wheel: finished with status 'done'
37.51   Preparing metadata (pyproject.toml): started
39.43   Preparing metadata (pyproject.toml): finished with status 'error'
39.46   error: subprocess-exited-with-error
39.46
39.46   × Preparing metadata (pyproject.toml) did not run successfully.
39.46   │ exit code: 1
39.46   ╰─> [40 lines of output]
39.46       Traceback (most recent call last):
39.46         File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
39.46           main()
...
39.46           ffi = FFI()
39.46         File "/tmp/pip-build-env-ogrzgl9d/overlay/local/lib/python3.10/dist-packages/cffi/api.py", line 54, in __init__
39.46           raise Exception("Version mismatch: this is the 'cffi' package version %s, located in %r.  When we import the top-level '_cffi_backend' extension module, we get version %s, located in %r.  The two versions should be equal; check your installation." % (
39.46       Exception: Version mismatch: this is the 'cffi' package version 1.16.0, located in '/tmp/pip-build-env-ogrzgl9d/overlay/local/lib/python3.10/dist-packages/cffi/api.py'.  When we import the top-level '_cffi_backend' extension module, we get version 1.15.0, located in '/usr/lib/python3/dist-packages/_cffi_backend.cpython-310-x86_64-linux-gnu.so'.  The two versions should be equal; check your installation.
39.46       [end of output]
39.46
39.46   note: This error originates from a subprocess, and is likely not a problem with pip.
39.47 error: metadata-generation-failed
39.47
39.47 × Encountered error while generating package metadata.
39.47 ╰─> See above for output.
39.47
39.47 note: This is an issue with the package mentioned above, not pip.
39.47 hint: See above for details.
------
failed to solve: process "/bin/sh -c pip3 install -r requirements.txt && rm requirements.txt" did not complete successfully: exit code: 1

I using Docker on Ubuntu 22.04

@lathama
Copy link

lathama commented Apr 2, 2024

@MyKeySoftMK I see 39.47 note: This is an issue with the package mentioned above, not pip. and wonder if there was a network glitch or other issue. This dockerfile does not look like any official dockerfile can you share where you found it?

If you have resolved this issue can you please close this issue?

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