Skip to content

Commit

Permalink
[IMP] Bump Python version, add dependencies
Browse files Browse the repository at this point in the history
- Odoo 14.0: add custom requirements.txt because Odoo has dropped version
support.
- Odoo 15.0, 16.0, 17.0: Use Python 3.12
  • Loading branch information
ivs-cetmix committed Dec 2, 2024
1 parent b84b9fe commit e9cd727
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 28 deletions.
14 changes: 7 additions & 7 deletions 14.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Parts of both Odoo and OCA Docker files are being used.
FROM python:3.10-slim-bullseye
FROM python:3.10-slim-bookworm

ARG ODOO_VERSION=14.0
ARG DOCKER_ODOO_UID=9999
Expand All @@ -14,7 +14,7 @@ ARG TMP_ADDONS_DIR=/tmp/getaddons
SHELL ["/bin/bash", "-xo", "pipefail", "-c"]

# Generate locale C.UTF-8 for postgres and general locale data
ENV LANG C.UTF-8
ENV LANG=C.UTF-8

# Install dependencies as describe in Odoo documentation
# https://www.odoo.com/documentation/14.0/administration/install/install.html#setup-install-source-linux-git
Expand All @@ -38,15 +38,15 @@ RUN apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -qq --n
RUN if [ -z "${TARGETARCH}" ]; then \
TARGETARCH="$(dpkg --print-architecture)"; \
fi; \
curl -sSL https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bullseye_${TARGETARCH}.deb -o /tmp/wkhtml.deb \
curl -sSL https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bookworm_${TARGETARCH}.deb -o /tmp/wkhtml.deb \
&& apt-get update -qq \
&& dpkg --force-depends -i /tmp/wkhtml.deb \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -f --no-install-recommends \
&& rm /tmp/wkhtml.deb

# Install latest version of the PG client
RUN curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" > /etc/apt/sources.list.d/pgclient.list \
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main" > /etc/apt/sources.list.d/pgclient.list \
&& apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq postgresql-client-${POSTGRES_VERSION}

Expand All @@ -65,8 +65,8 @@ RUN pip install --no-cache-dir --upgrade pip && \


# Install Odoo python dependencies
RUN curl https://raw.githubusercontent.com/odoo/odoo/${ODOO_VERSION}/requirements.txt > /tmp/requirements.txt && \
pip3 install -r /tmp/requirements.txt
COPY requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt

# Add "odoo" user. We use same guid uid as in the official Odoo image
RUN groupadd --gid ${DOCKER_ODOO_GID} odoo && useradd odoo -u ${DOCKER_ODOO_UID} -g ${DOCKER_ODOO_GID} -m -s /bin/bash
Expand Down Expand Up @@ -167,7 +167,7 @@ VOLUME ["/var/lib/odoo"]
EXPOSE 8069 8071 8072

# Set the default config file
ENV ODOO_RC /etc/odoo.conf
ENV ODOO_RC=/etc/odoo.conf

# Set db manager password
ARG DB_MANAGER_PASSWORD=suchMuchPassword
Expand Down
14 changes: 7 additions & 7 deletions 14.0/Dockerfile.odoo
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Parts of both Odoo and OCA Docker files are being used.
#
# This image contains build Odoo core image tools for adding extra addons.
FROM python:3.10-slim-bullseye
FROM python:3.10-slim-bookworm

ARG ODOO_VERSION=14.0
ARG DOCKER_ODOO_UID=9999
Expand All @@ -18,7 +18,7 @@ ARG TMP_ADDONS_DIR=/tmp/getaddons
SHELL ["/bin/bash", "-xo", "pipefail", "-c"]

# Generate locale C.UTF-8 for postgres and general locale data
ENV LANG C.UTF-8
ENV LANG=C.UTF-8

# Install dependencies as describe in Odoo documentation
# https://www.odoo.com/documentation/14.0/administration/install/install.html#setup-install-source-linux-git
Expand All @@ -43,15 +43,15 @@ RUN apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -qq --n
RUN if [ -z "${TARGETARCH}" ]; then \
TARGETARCH="$(dpkg --print-architecture)"; \
fi; \
curl -sSL https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bullseye_${TARGETARCH}.deb -o /tmp/wkhtml.deb \
curl -sSL https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bookworm_${TARGETARCH}.deb -o /tmp/wkhtml.deb \
&& apt-get update -qq \
&& dpkg --force-depends -i /tmp/wkhtml.deb \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -f --no-install-recommends \
&& rm /tmp/wkhtml.deb

# Install latest version of the PG client
RUN curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" > /etc/apt/sources.list.d/pgclient.list \
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main" > /etc/apt/sources.list.d/pgclient.list \
&& apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq postgresql-client-${POSTGRES_VERSION}

Expand All @@ -70,8 +70,8 @@ RUN pip install --no-cache-dir --upgrade pip && \


# Install Odoo python dependencies
RUN curl https://raw.githubusercontent.com/odoo/odoo/${ODOO_VERSION}/requirements.txt > /tmp/requirements.txt && \
pip3 install -r /tmp/requirements.txt
COPY requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt

# Add "odoo" user. We use same guid uid as in the official Odoo image
RUN groupadd --gid ${DOCKER_ODOO_GID} odoo && useradd odoo -u ${DOCKER_ODOO_UID} -g ${DOCKER_ODOO_GID} -m -s /bin/bash
Expand Down Expand Up @@ -106,7 +106,7 @@ VOLUME ["/var/lib/odoo"]
EXPOSE 8069 8071 8072

# Set the default config file
ENV ODOO_RC /etc/odoo.conf
ENV ODOO_RC=/etc/odoo.conf

# Set default user when running the container
USER odoo
Expand Down
45 changes: 45 additions & 0 deletions 14.0/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Updated by Cetmix because Odoo has dropped this Odoo version from support
Babel==2.9.1; python_version > '3.9' # (Jammy) 2.6.0 has issues with python 3.10
chardet==3.0.4
decorator==4.3.0
docutils==0.14
ebaysdk==2.1.5
freezegun==0.3.15; python_version >= '3.8'
gevent==1.1.2 ; sys_platform != 'win32' and python_version < '3.7'
gevent==20.9.0 ; python_version > '3.7' and python_version <= '3.9'
gevent>=24.11.0 ; python_version > '3.9' # (Jammy)
greenlet==0.4.17 ; python_version > '3.7' and python_version <= '3.9'
greenlet>=3.1.1 ; python_version > '3.9' # (Jammy)
idna==2.6
# bullseye version, focal patched 2.10
Jinja2==2.11.2; python_version >= '3.8'
libsass==0.17.0
# lxml 4.6.1 has incompatibility issues with python 3.10
lxml==4.6.5 ; sys_platform != 'win32' and python_version > '3.7' # min version = 4.5.0 (Focal - with security backports)
Mako==1.0.7
MarkupSafe==1.1.0
num2words==0.5.6
ofxparse==0.21; python_version > '3.9' # (Jammy) ABC removed from collections in 3.10 but still used in ofxparse < 0.21
passlib==1.7.1
Pillow==8.1.1 ; python_version > '3.7'
polib==1.1.0
psutil==5.6.6
psycopg2==2.8.5; sys_platform == 'win32' or python_version >= '3.8'
pydot==1.4.1
python-ldap==3.1.0; sys_platform != 'win32'
PyPDF2==1.26.0
pyserial==3.4
python-dateutil==2.7.3
pytz # no version pinning to avoid OS perturbations
pyusb==1.0.2
qrcode==6.1
reportlab==3.5.55; python_version >= '3.8'
requests==2.25.1; python_version > '3.9' # (Jammy) versions < 2.25 aren't compatible w/ urllib3 1.26. Bullseye = 2.25.1. min version = 2.22.0 (Focal)
urllib3==1.26.5; python_version > '3.9' # (Jammy) indirect / min version = 1.25.8 (Focal with security backports)
zeep==3.2.0
python-stdnum==1.8
vobject==0.9.6.1
Werkzeug==2.0.2 ; python_version > '3.9' # (Jammy)
XlsxWriter==1.1.2
xlwt==1.3.*
xlrd==1.2.0; python_version >= '3.8'
10 changes: 5 additions & 5 deletions 15.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Parts of both Odoo and OCA Docker files are being used.
FROM python:3.10-slim-bullseye
FROM python:3.12-slim-bookworm

ARG ODOO_VERSION=15.0
ARG DOCKER_ODOO_UID=9999
Expand All @@ -14,7 +14,7 @@ ARG TMP_ADDONS_DIR=/tmp/getaddons
SHELL ["/bin/bash", "-xo", "pipefail", "-c"]

# Generate locale C.UTF-8 for postgres and general locale data
ENV LANG C.UTF-8
ENV LANG=C.UTF-8

# Install dependencies as describe in Odoo documentation
# https://www.odoo.com/documentation/15.0/administration/install/install.html#setup-install-source-linux-git
Expand All @@ -39,15 +39,15 @@ RUN apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -qq --n
RUN if [ -z "${TARGETARCH}" ]; then \
TARGETARCH="$(dpkg --print-architecture)"; \
fi; \
curl -sSL https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bullseye_${TARGETARCH}.deb -o /tmp/wkhtml.deb \
curl -sSL https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bookworm_${TARGETARCH}.deb -o /tmp/wkhtml.deb \
&& apt-get update -qq \
&& dpkg --force-depends -i /tmp/wkhtml.deb \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -f --no-install-recommends \
&& rm /tmp/wkhtml.deb

# Install latest version of the PG client
RUN curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" > /etc/apt/sources.list.d/pgclient.list \
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main" > /etc/apt/sources.list.d/pgclient.list \
&& apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq postgresql-client-${POSTGRES_VERSION}

Expand Down Expand Up @@ -168,7 +168,7 @@ VOLUME ["/var/lib/odoo"]
EXPOSE 8069 8071 8072

# Set the default config file
ENV ODOO_RC /etc/odoo.conf
ENV ODOO_RC=/etc/odoo.conf

# Set db manager password
ARG DB_MANAGER_PASSWORD=suchMuchPassword
Expand Down
10 changes: 5 additions & 5 deletions 15.0/Dockerfile.odoo
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Parts of both Odoo and OCA Docker files are being used.
#
# This image contains build Odoo core image tools for adding extra addons.
FROM python:3.10-slim-bullseye
FROM python:3.12-slim-bookworm

ARG ODOO_VERSION=15.0
ARG DOCKER_ODOO_UID=9999
Expand All @@ -18,7 +18,7 @@ ARG TMP_ADDONS_DIR=/tmp/getaddons
SHELL ["/bin/bash", "-xo", "pipefail", "-c"]

# Generate locale C.UTF-8 for postgres and general locale data
ENV LANG C.UTF-8
ENV LANG=C.UTF-8

# Install dependencies as describe in Odoo documentation
# https://www.odoo.com/documentation/15.0/administration/install/install.html#setup-install-source-linux-git
Expand All @@ -43,15 +43,15 @@ RUN apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -qq --n
RUN if [ -z "${TARGETARCH}" ]; then \
TARGETARCH="$(dpkg --print-architecture)"; \
fi; \
curl -sSL https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bullseye_${TARGETARCH}.deb -o /tmp/wkhtml.deb \
curl -sSL https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bookworm_${TARGETARCH}.deb -o /tmp/wkhtml.deb \
&& apt-get update -qq \
&& dpkg --force-depends -i /tmp/wkhtml.deb \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -f --no-install-recommends \
&& rm /tmp/wkhtml.deb

# Install latest version of the PG client
RUN curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" > /etc/apt/sources.list.d/pgclient.list \
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main" > /etc/apt/sources.list.d/pgclient.list \
&& apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq postgresql-client-${POSTGRES_VERSION}

Expand Down Expand Up @@ -106,7 +106,7 @@ VOLUME ["/var/lib/odoo"]
EXPOSE 8069 8071 8072

# Set the default config file
ENV ODOO_RC /etc/odoo.conf
ENV ODOO_RC=/etc/odoo.conf

# Set default user when running the container
USER odoo
Expand Down
2 changes: 1 addition & 1 deletion 16.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Parts of both Odoo and OCA Docker files are being used.
FROM python:3.11-slim-bookworm
FROM python:3.12-slim-bookworm

ARG ODOO_VERSION=16.0
ARG DOCKER_ODOO_UID=9999
Expand Down
2 changes: 1 addition & 1 deletion 16.0/Dockerfile.odoo
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Parts of both Odoo and OCA Docker files are being used.
#
# This image contains build Odoo core image tools for adding extra addons.
FROM python:3.11-slim-bookworm
FROM python:3.12-slim-bookworm

ARG ODOO_VERSION=16.0
ARG DOCKER_ODOO_UID=9999
Expand Down
2 changes: 1 addition & 1 deletion 17.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Parts of both Odoo and OCA Docker files are being used.
FROM python:3.11-slim-bookworm
FROM python:3.12-slim-bookworm

ARG ODOO_VERSION=17.0
ARG DOCKER_ODOO_UID=9999
Expand Down
2 changes: 1 addition & 1 deletion 17.0/Dockerfile.odoo
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Parts of both Odoo and OCA Docker files are being used.
#
# This image contains build Odoo core image tools for adding extra addons.
FROM python:3.11-slim-bookworm
FROM python:3.12-slim-bookworm

ARG ODOO_VERSION=17.0
ARG DOCKER_ODOO_UID=9999
Expand Down

0 comments on commit e9cd727

Please sign in to comment.