How install the requirements for odoo 17 in offical Docker

Aperta
#479 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
docker, python
Ambito
devops

Direzione di ricerca

Start with the Dockerfile's pip3 install -r requirements.txt step and the Odoo 17.0 requirements.txt it downloads. Reproduce the build on the Ubuntu Jammy base, then inspect the gevent, cffi, and system Python package versions shown in the error. Done means the requirements install completes successfully in the official Odoo 17 Docker build.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Dockerfile
Stelle
1.2k
Fork
1.7k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di odoo/docker

Tutte le issue di odoo/docker

Issue simili

Altre issue su DevOps

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.