From 9409487426e5556f31bb1293ba63b6138d53cfe8 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Wed, 9 Oct 2019 14:25:19 +0200 Subject: [PATCH] [FIX] 11.0-13.0: install phonenumbers and use slim images While phonenumbers is not required to run Odoo, it's a requested nice to have. To avoid a red warning while installing num2words with pip, the Debian backport repository is used. Also use Debian slim images to gain some space. closes #245 and closes #168 --- 11.0/Dockerfile | 9 +++++++-- 12.0/Dockerfile | 9 +++++++-- 13.0/Dockerfile | 6 ++++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/11.0/Dockerfile b/11.0/Dockerfile index 99421e3..aca47f4 100644 --- a/11.0/Dockerfile +++ b/11.0/Dockerfile @@ -1,9 +1,12 @@ -FROM debian:stretch +FROM debian:stretch-slim MAINTAINER Odoo S.A. # Generate locale C.UTF-8 for postgres and general locale data ENV LANG C.UTF-8 +# Use backports to avoid install some libs with pip +RUN echo 'deb http://deb.debian.org/debian stretch-backports main' > /etc/apt/sources.list.d/backports.list + # Install some deps, lessc and less-plugin-clean-css, and wkhtmltopdf RUN set -x; \ apt-get update \ @@ -15,13 +18,16 @@ RUN set -x; \ gnupg \ libssl1.0-dev \ node-less \ + python3-num2words \ python3-pip \ + python3-phonenumbers \ python3-pyldap \ python3-qrcode \ python3-renderpm \ python3-setuptools \ python3-vobject \ python3-watchdog \ + python3-xlwt \ xz-utils \ && curl -o wkhtmltox.deb -sSL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb \ && echo '7e35a63f9db14f93ec7feeb0fce76b30c08f2057 wkhtmltox.deb' | sha1sum -c - \ @@ -55,7 +61,6 @@ RUN set -x; \ && rm -rf /var/lib/apt/lists/* odoo.deb # Copy entrypoint script and Odoo configuration file -RUN pip3 install num2words xlwt COPY ./entrypoint.sh / COPY ./odoo.conf /etc/odoo/ RUN chown odoo /etc/odoo/odoo.conf diff --git a/12.0/Dockerfile b/12.0/Dockerfile index cb96a8d..3442b53 100644 --- a/12.0/Dockerfile +++ b/12.0/Dockerfile @@ -1,9 +1,12 @@ -FROM debian:stretch +FROM debian:stretch-slim MAINTAINER Odoo S.A. # Generate locale C.UTF-8 for postgres and general locale data ENV LANG C.UTF-8 +# Use backports to avoid install some libs with pip +RUN echo 'deb http://deb.debian.org/debian stretch-backports main' > /etc/apt/sources.list.d/backports.list + # Install some deps, lessc and less-plugin-clean-css, and wkhtmltopdf RUN set -x; \ apt-get update \ @@ -15,13 +18,16 @@ RUN set -x; \ gnupg \ libssl1.0-dev \ node-less \ + python3-num2words \ python3-pip \ + python3-phonenumbers \ python3-pyldap \ python3-qrcode \ python3-renderpm \ python3-setuptools \ python3-vobject \ python3-watchdog \ + python3-xlwt \ xz-utils \ && curl -o wkhtmltox.deb -sSL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb \ && echo '7e35a63f9db14f93ec7feeb0fce76b30c08f2057 wkhtmltox.deb' | sha1sum -c - \ @@ -69,7 +75,6 @@ RUN set -x; \ && rm -rf /var/lib/apt/lists/* odoo.deb # Copy entrypoint script and Odoo configuration file -RUN pip3 install num2words xlwt COPY ./entrypoint.sh / COPY ./odoo.conf /etc/odoo/ RUN chown odoo /etc/odoo/odoo.conf diff --git a/13.0/Dockerfile b/13.0/Dockerfile index 4dc24e4..e5525d0 100644 --- a/13.0/Dockerfile +++ b/13.0/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:buster +FROM debian:buster-slim MAINTAINER Odoo S.A. # Generate locale C.UTF-8 for postgres and general locale data @@ -16,13 +16,16 @@ RUN set -x; \ libssl-dev \ node-less \ npm \ + python3-num2words \ python3-pip \ + python3-phonenumbers \ python3-pyldap \ python3-qrcode \ python3-renderpm \ python3-setuptools \ python3-vobject \ python3-watchdog \ + python3-xlwt \ xz-utils \ && curl -o wkhtmltox.deb -sSL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb \ && echo '7e35a63f9db14f93ec7feeb0fce76b30c08f2057 wkhtmltox.deb' | sha1sum -c - \ @@ -60,7 +63,6 @@ RUN set -x; \ && rm -rf /var/lib/apt/lists/* odoo.deb # Copy entrypoint script and Odoo configuration file -RUN pip3 install num2words xlwt COPY ./entrypoint.sh / COPY ./odoo.conf /etc/odoo/ RUN chown odoo /etc/odoo/odoo.conf