From 05c776bcb2b0c8cda8d6fbb0bf93818b6c2625c7 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Mon, 26 Nov 2018 13:38:47 +0100 Subject: [PATCH 01/24] [FIX] Odoo 10.0-12.0: add missing packages In Odoo, ldap, qrcode and vobject python modules are set as required in odoo/setup.py. On the other hand, they are only recommendend in the Debian package. As a consequence, it was difficult to run some Odoo modules that required one of them. The Odoo Debian package was adapted in master where they were added as dependencies in odoo/odoo@2ff49c5fcb584c8215ecbcb0034690e53732fb49 . With this commit, they are installed in the Docker images. This is a part of the fix of odoo/odoo#27752. --- 10.0/Dockerfile | 3 +++ 11.0/Dockerfile | 9 ++++++--- 12.0/Dockerfile | 9 ++++++--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/10.0/Dockerfile b/10.0/Dockerfile index 1321f12..5dbebc8 100644 --- a/10.0/Dockerfile +++ b/10.0/Dockerfile @@ -9,9 +9,12 @@ RUN set -x; \ curl \ node-less \ python-gevent \ + python-ldap \ python-pip \ + python-qrcode \ python-renderpm \ python-support \ + python-vobject \ python-watchdog \ && curl -o wkhtmltox.deb -SL http://nightly.odoo.com/extra/wkhtmltox-0.12.1.2_linux-jessie-amd64.deb \ && echo '40e8b906de658a2221b15e4e8cd82565a47d7ee8 wkhtmltox.deb' | sha1sum -c - \ diff --git a/11.0/Dockerfile b/11.0/Dockerfile index 007012b..3eb1d19 100644 --- a/11.0/Dockerfile +++ b/11.0/Dockerfile @@ -10,13 +10,16 @@ RUN set -x; \ && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ + libssl1.0-dev \ node-less \ python3-pip \ - python3-setuptools \ + python3-pyldap \ + python3-qrcode \ python3-renderpm \ - libssl1.0-dev \ - xz-utils \ + python3-setuptools \ + python3-vobject \ python3-watchdog \ + xz-utils \ && curl -o wkhtmltox.tar.xz -SL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz \ && echo '3f923f425d345940089e44c1466f6408b9619562 wkhtmltox.tar.xz' | sha1sum -c - \ && tar xvf wkhtmltox.tar.xz \ diff --git a/12.0/Dockerfile b/12.0/Dockerfile index beb6327..43903f4 100644 --- a/12.0/Dockerfile +++ b/12.0/Dockerfile @@ -10,13 +10,16 @@ RUN set -x; \ && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ + libssl1.0-dev \ node-less \ python3-pip \ - python3-setuptools \ + python3-pyldap \ + python3-qrcode \ python3-renderpm \ - libssl1.0-dev \ - xz-utils \ + python3-setuptools \ + python3-vobject \ python3-watchdog \ + xz-utils \ && curl -o wkhtmltox.tar.xz -SL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz \ && echo '3f923f425d345940089e44c1466f6408b9619562 wkhtmltox.tar.xz' | sha1sum -c - \ && tar xvf wkhtmltox.tar.xz \ From 5935496f14579dd4f0b04c8d680c585c1c7c518c Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Mon, 26 Nov 2018 14:10:38 +0100 Subject: [PATCH 02/24] [FIX] Odoo 10.0-12.0: update wkhtmltopdf to recommended version wkhtmltopdf 0.12.5 is now the recommended version. This commiit uses the Debian packages that exist for Jessie and Stretch. Fixes #220 --- 10.0/Dockerfile | 4 ++-- 11.0/Dockerfile | 11 +++++------ 12.0/Dockerfile | 11 +++++------ 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/10.0/Dockerfile b/10.0/Dockerfile index 5dbebc8..cbf8be0 100644 --- a/10.0/Dockerfile +++ b/10.0/Dockerfile @@ -16,8 +16,8 @@ RUN set -x; \ python-support \ python-vobject \ python-watchdog \ - && curl -o wkhtmltox.deb -SL http://nightly.odoo.com/extra/wkhtmltox-0.12.1.2_linux-jessie-amd64.deb \ - && echo '40e8b906de658a2221b15e4e8cd82565a47d7ee8 wkhtmltox.deb' | sha1sum -c - \ + && curl -o wkhtmltox.deb -SL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.jessie_amd64.deb \ + && echo '4d104ff338dc2d2083457b3b1e9baab8ddf14202 wkhtmltox.deb' | sha1sum -c - \ && dpkg --force-depends -i wkhtmltox.deb \ && apt-get -y install -f --no-install-recommends \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false npm \ diff --git a/11.0/Dockerfile b/11.0/Dockerfile index 3eb1d19..dea09d4 100644 --- a/11.0/Dockerfile +++ b/11.0/Dockerfile @@ -20,12 +20,11 @@ RUN set -x; \ python3-vobject \ python3-watchdog \ xz-utils \ - && curl -o wkhtmltox.tar.xz -SL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz \ - && echo '3f923f425d345940089e44c1466f6408b9619562 wkhtmltox.tar.xz' | sha1sum -c - \ - && tar xvf wkhtmltox.tar.xz \ - && cp wkhtmltox/lib/* /usr/local/lib/ \ - && cp wkhtmltox/bin/* /usr/local/bin/ \ - && cp -r wkhtmltox/share/man/man1 /usr/local/share/man/ + && curl -o wkhtmltox.deb -SL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb \ + && echo '7e35a63f9db14f93ec7feeb0fce76b30c08f2057 wkhtmltox.deb' | sha1sum -c - \ + && dpkg --force-depends -i wkhtmltox.deb\ + && apt-get -y install -f --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* wkhtmltox.deb # Install Odoo ENV ODOO_VERSION 11.0 diff --git a/12.0/Dockerfile b/12.0/Dockerfile index 43903f4..8d48358 100644 --- a/12.0/Dockerfile +++ b/12.0/Dockerfile @@ -20,12 +20,11 @@ RUN set -x; \ python3-vobject \ python3-watchdog \ xz-utils \ - && curl -o wkhtmltox.tar.xz -SL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz \ - && echo '3f923f425d345940089e44c1466f6408b9619562 wkhtmltox.tar.xz' | sha1sum -c - \ - && tar xvf wkhtmltox.tar.xz \ - && cp wkhtmltox/lib/* /usr/local/lib/ \ - && cp wkhtmltox/bin/* /usr/local/bin/ \ - && cp -r wkhtmltox/share/man/man1 /usr/local/share/man/ + && curl -o wkhtmltox.deb -SL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb \ + && echo '7e35a63f9db14f93ec7feeb0fce76b30c08f2057 wkhtmltox.deb' | sha1sum -c - \ + && dpkg --force-depends -i wkhtmltox.deb\ + && apt-get -y install -f --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* wkhtmltox.deb # Install Odoo ENV ODOO_VERSION 12.0 From d0360678214b8f70970a2369a5a6b37981ab2c45 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Mon, 26 Nov 2018 14:15:56 +0100 Subject: [PATCH 03/24] [REF] Odoo 10.0-12.0: update to release 20181126 --- 10.0/Dockerfile | 4 ++-- 11.0/Dockerfile | 4 ++-- 12.0/Dockerfile | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/10.0/Dockerfile b/10.0/Dockerfile index cbf8be0..ee1ab72 100644 --- a/10.0/Dockerfile +++ b/10.0/Dockerfile @@ -26,10 +26,10 @@ RUN set -x; \ # Install Odoo ENV ODOO_VERSION 10.0 -ENV ODOO_RELEASE 20181109 +ENV ODOO_RELEASE 20181126 RUN set -x; \ curl -o odoo.deb -SL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ - && echo '8b24a5a3e36aed8986d3d6b19c8a255ee72cd658 odoo.deb' | sha1sum -c - \ + && echo 'a68f31336b103c9cc334d8eb2f88bd5e754b5d74 odoo.deb' | sha1sum -c - \ && dpkg --force-depends -i odoo.deb \ && apt-get update \ && apt-get -y install -f --no-install-recommends \ diff --git a/11.0/Dockerfile b/11.0/Dockerfile index dea09d4..618b4eb 100644 --- a/11.0/Dockerfile +++ b/11.0/Dockerfile @@ -28,10 +28,10 @@ RUN set -x; \ # Install Odoo ENV ODOO_VERSION 11.0 -ENV ODOO_RELEASE 20181109 +ENV ODOO_RELEASE 20181126 RUN set -x; \ curl -o odoo.deb -SL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ - && echo '04823230d99d16dbaf157c55cfad632db4559060 odoo.deb' | sha1sum -c - \ + && echo '57e270cd958ca97b3920d7187c8967e1458d975c odoo.deb' | sha1sum -c - \ && dpkg --force-depends -i odoo.deb \ && apt-get update \ && apt-get -y install -f --no-install-recommends \ diff --git a/12.0/Dockerfile b/12.0/Dockerfile index 8d48358..c2b1c83 100644 --- a/12.0/Dockerfile +++ b/12.0/Dockerfile @@ -28,10 +28,10 @@ RUN set -x; \ # Install Odoo ENV ODOO_VERSION 12.0 -ENV ODOO_RELEASE 20181109 +ENV ODOO_RELEASE 20181126 RUN set -x; \ curl -o odoo.deb -SL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ - && echo 'fcaa0f72ecc8a4fa5636948a8966f7584eab1fac odoo.deb' | sha1sum -c - \ + && echo '30fb8530c596d5606b079c45f1be15f423431fdd odoo.deb' | sha1sum -c - \ && dpkg --force-depends -i odoo.deb \ && apt-get update \ && apt-get -y install -f --no-install-recommends \ From 5cc7eae335ced1014b4f984e733e0093774618f9 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Tue, 29 Jan 2019 13:37:17 +0100 Subject: [PATCH 04/24] [FIX] Odoo 10.0-12.0: remove deprecated MAINTAINER instruction The MAINTAINER instruction is deprecated since Docker version 1.13. With this commit, the LABEL instruction is used instead. --- 10.0/Dockerfile | 2 +- 11.0/Dockerfile | 2 +- 12.0/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/10.0/Dockerfile b/10.0/Dockerfile index ee1ab72..e3c5183 100644 --- a/10.0/Dockerfile +++ b/10.0/Dockerfile @@ -1,5 +1,5 @@ FROM debian:jessie -MAINTAINER Odoo S.A. +LABEL maintainer="Odoo S.A. " # Install some deps, lessc and less-plugin-clean-css, and wkhtmltopdf RUN set -x; \ diff --git a/11.0/Dockerfile b/11.0/Dockerfile index 618b4eb..43f57dd 100644 --- a/11.0/Dockerfile +++ b/11.0/Dockerfile @@ -1,5 +1,5 @@ FROM debian:stretch -MAINTAINER Odoo S.A. +LABEL maintainer="Odoo S.A. " # Generate locale C.UTF-8 for postgres and general locale data ENV LANG C.UTF-8 diff --git a/12.0/Dockerfile b/12.0/Dockerfile index c2b1c83..0ff9df4 100644 --- a/12.0/Dockerfile +++ b/12.0/Dockerfile @@ -1,5 +1,5 @@ FROM debian:stretch -MAINTAINER Odoo S.A. +LABEL maintainer="Odoo S.A. " # Generate locale C.UTF-8 for postgres and general locale data ENV LANG C.UTF-8 From 5ef3bee9dc1de5c5a486f6e2760c4a4de6e50da5 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Tue, 29 Jan 2019 14:03:05 +0100 Subject: [PATCH 05/24] [FIX] Odoo 10.0-12.0: make curl download quieter When downloading wkhtmltopdf, curl shows a progress status unecessary during the builds. --- 10.0/Dockerfile | 2 +- 11.0/Dockerfile | 2 +- 12.0/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/10.0/Dockerfile b/10.0/Dockerfile index e3c5183..4420ffa 100644 --- a/10.0/Dockerfile +++ b/10.0/Dockerfile @@ -16,7 +16,7 @@ RUN set -x; \ python-support \ python-vobject \ python-watchdog \ - && curl -o wkhtmltox.deb -SL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.jessie_amd64.deb \ + && curl -o wkhtmltox.deb -sSL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.jessie_amd64.deb \ && echo '4d104ff338dc2d2083457b3b1e9baab8ddf14202 wkhtmltox.deb' | sha1sum -c - \ && dpkg --force-depends -i wkhtmltox.deb \ && apt-get -y install -f --no-install-recommends \ diff --git a/11.0/Dockerfile b/11.0/Dockerfile index 43f57dd..73a7e81 100644 --- a/11.0/Dockerfile +++ b/11.0/Dockerfile @@ -20,7 +20,7 @@ RUN set -x; \ python3-vobject \ python3-watchdog \ xz-utils \ - && curl -o wkhtmltox.deb -SL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb \ + && 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 - \ && dpkg --force-depends -i wkhtmltox.deb\ && apt-get -y install -f --no-install-recommends \ diff --git a/12.0/Dockerfile b/12.0/Dockerfile index 0ff9df4..667afab 100644 --- a/12.0/Dockerfile +++ b/12.0/Dockerfile @@ -20,7 +20,7 @@ RUN set -x; \ python3-vobject \ python3-watchdog \ xz-utils \ - && curl -o wkhtmltox.deb -SL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb \ + && 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 - \ && dpkg --force-depends -i wkhtmltox.deb\ && apt-get -y install -f --no-install-recommends \ From 01f0a1e508ef09641608a306b6323f4ecd5e3349 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Tue, 29 Jan 2019 14:34:05 +0100 Subject: [PATCH 06/24] [FIX] Odoo 10.0-12.0: use latest postgresql-client As the Odoo Docker images are based on Debian Jessie and Stretch, they use the postgresql-client package from the respective Debian repo. The backup feature of Odoo uses the postgresql-client. As a consequence, if a database server newer than the client is used, the backup may fail. For example, when using the Odoo Docker image 10.0 against a postgresql server 10.0, the backup fails. With this commit, the latest postgresql-client is used from the Postgres repository. As they seem to be backward compatible, the Odoo backup will succeed wathever the client/server combination. fixes odoo/odoo#30599 --- 10.0/Dockerfile | 7 +++++++ 11.0/Dockerfile | 8 ++++++++ 12.0/Dockerfile | 8 ++++++++ 3 files changed, 23 insertions(+) diff --git a/10.0/Dockerfile b/10.0/Dockerfile index 4420ffa..1dd1976 100644 --- a/10.0/Dockerfile +++ b/10.0/Dockerfile @@ -24,6 +24,13 @@ RUN set -x; \ && rm -rf /var/lib/apt/lists/* wkhtmltox.deb \ && pip install psycogreen==1.0 +# install latest postgresql-client +RUN set -x; \ + echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' > etc/apt/sources.list.d/pgdg.list \ + && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ + && apt-get update \ + && apt-get install -y postgresql-client + # Install Odoo ENV ODOO_VERSION 10.0 ENV ODOO_RELEASE 20181126 diff --git a/11.0/Dockerfile b/11.0/Dockerfile index 73a7e81..8ba15ee 100644 --- a/11.0/Dockerfile +++ b/11.0/Dockerfile @@ -10,6 +10,7 @@ RUN set -x; \ && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ + gnupg \ libssl1.0-dev \ node-less \ python3-pip \ @@ -26,6 +27,13 @@ RUN set -x; \ && apt-get -y install -f --no-install-recommends \ && rm -rf /var/lib/apt/lists/* wkhtmltox.deb +# install latest postgresql-client +RUN set -x; \ + echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' > etc/apt/sources.list.d/pgdg.list \ + && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ + && apt-get update \ + && apt-get install -y postgresql-client + # Install Odoo ENV ODOO_VERSION 11.0 ENV ODOO_RELEASE 20181126 diff --git a/12.0/Dockerfile b/12.0/Dockerfile index 667afab..0bff965 100644 --- a/12.0/Dockerfile +++ b/12.0/Dockerfile @@ -10,6 +10,7 @@ RUN set -x; \ && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ + gnupg \ libssl1.0-dev \ node-less \ python3-pip \ @@ -26,6 +27,13 @@ RUN set -x; \ && apt-get -y install -f --no-install-recommends \ && rm -rf /var/lib/apt/lists/* wkhtmltox.deb +# install latest postgresql-client +RUN set -x; \ + echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' > etc/apt/sources.list.d/pgdg.list \ + && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ + && apt-get update \ + && apt-get install -y postgresql-client + # Install Odoo ENV ODOO_VERSION 12.0 ENV ODOO_RELEASE 20181126 From a1463daf598a958d6df9680b688436bc93ddf747 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Tue, 29 Jan 2019 14:41:08 +0100 Subject: [PATCH 07/24] [FIX] Odoo 11.0-12.0: add asian fonts and rtlcss When printing a report, the asian fonts were missing. Also, since Odoo 12.0, rtlcss is needed to support the right-to-left languages in the Odoo UI. With this commit, the noto-cjk fonts are added as well as the nodejs rtlcss tool. --- 11.0/Dockerfile | 1 + 12.0/Dockerfile | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/11.0/Dockerfile b/11.0/Dockerfile index 8ba15ee..f17bcf6 100644 --- a/11.0/Dockerfile +++ b/11.0/Dockerfile @@ -10,6 +10,7 @@ RUN set -x; \ && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ + fonts-noto-cjk \ gnupg \ libssl1.0-dev \ node-less \ diff --git a/12.0/Dockerfile b/12.0/Dockerfile index 0bff965..629fd6e 100644 --- a/12.0/Dockerfile +++ b/12.0/Dockerfile @@ -10,6 +10,7 @@ RUN set -x; \ && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ + fonts-noto-cjk \ gnupg \ libssl1.0-dev \ node-less \ @@ -34,6 +35,14 @@ RUN set -x; \ && apt-get update \ && apt-get install -y postgresql-client +# Install rtlcss (on Debian stretch) +RUN set -x;\ + curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \ + && echo "deb http://deb.nodesource.com/node_8.x stretch main" > /etc/apt/sources.list.d/nodesource.list \ + && apt-get update \ + && apt-get install -y nodejs \ + && npm install -g rtlcss + # Install Odoo ENV ODOO_VERSION 12.0 ENV ODOO_RELEASE 20181126 From 4ab61856147123f7f1726c78c3da3f2136e435fe Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Tue, 29 Jan 2019 14:47:10 +0100 Subject: [PATCH 08/24] [REF] Odoo 10.0-12.0: update to release 20190128 the release timestamp and the verification sha1 are now using an ARG instruction. It means that they can be specified on the command line argument at the build time. --- 10.0/Dockerfile | 7 ++++--- 11.0/Dockerfile | 7 ++++--- 12.0/Dockerfile | 7 ++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/10.0/Dockerfile b/10.0/Dockerfile index 1dd1976..967a5b1 100644 --- a/10.0/Dockerfile +++ b/10.0/Dockerfile @@ -33,10 +33,11 @@ RUN set -x; \ # Install Odoo ENV ODOO_VERSION 10.0 -ENV ODOO_RELEASE 20181126 +ARG ODOO_RELEASE=20190128 +ARG ODOO_SHA=673bb5e45c006c9a822a0ca1a7d19989c03151ad RUN set -x; \ - curl -o odoo.deb -SL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ - && echo 'a68f31336b103c9cc334d8eb2f88bd5e754b5d74 odoo.deb' | sha1sum -c - \ + curl -o odoo.deb -sSL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ + && echo "${ODOO_SHA} odoo.deb" | sha1sum -c - \ && dpkg --force-depends -i odoo.deb \ && apt-get update \ && apt-get -y install -f --no-install-recommends \ diff --git a/11.0/Dockerfile b/11.0/Dockerfile index f17bcf6..328aa18 100644 --- a/11.0/Dockerfile +++ b/11.0/Dockerfile @@ -37,10 +37,11 @@ RUN set -x; \ # Install Odoo ENV ODOO_VERSION 11.0 -ENV ODOO_RELEASE 20181126 +ARG ODOO_RELEASE=20190128 +ARG ODOO_SHA=30cb83ce38ec0b4a459e5590407cb2f9dcf46061 RUN set -x; \ - curl -o odoo.deb -SL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ - && echo '57e270cd958ca97b3920d7187c8967e1458d975c odoo.deb' | sha1sum -c - \ + curl -o odoo.deb -sSL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ + && echo "${ODOO_SHA} odoo.deb" | sha1sum -c - \ && dpkg --force-depends -i odoo.deb \ && apt-get update \ && apt-get -y install -f --no-install-recommends \ diff --git a/12.0/Dockerfile b/12.0/Dockerfile index 629fd6e..3c24fdc 100644 --- a/12.0/Dockerfile +++ b/12.0/Dockerfile @@ -45,10 +45,11 @@ RUN set -x;\ # Install Odoo ENV ODOO_VERSION 12.0 -ENV ODOO_RELEASE 20181126 +ARG ODOO_RELEASE=20190128 +ARG ODOO_SHA=9e34aaed2eb1e7697aaf36767247dbf335e9fe7a RUN set -x; \ - curl -o odoo.deb -SL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ - && echo '30fb8530c596d5606b079c45f1be15f423431fdd odoo.deb' | sha1sum -c - \ + curl -o odoo.deb -sSL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ + && echo "${ODOO_SHA} odoo.deb" | sha1sum -c - \ && dpkg --force-depends -i odoo.deb \ && apt-get update \ && apt-get -y install -f --no-install-recommends \ From 87f0174dca7fb69e504d0720104779989f00b368 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Wed, 30 Jan 2019 15:43:24 +0100 Subject: [PATCH 09/24] [FIX] Odoo 10.0-12.0: use a more secure way to download keys At build time, curl is used to download gnupg keys without any verification. This does not meet the Docker hub requirements: https://github.com/docker-library/official-images#security With this commit, gpg is used to download the keys with the best method specified in the requirements. --- 10.0/Dockerfile | 6 +++++- 11.0/Dockerfile | 7 ++++++- 12.0/Dockerfile | 15 ++++++++++++--- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/10.0/Dockerfile b/10.0/Dockerfile index 967a5b1..dabd05a 100644 --- a/10.0/Dockerfile +++ b/10.0/Dockerfile @@ -7,6 +7,7 @@ RUN set -x; \ && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ + dirmngr \ node-less \ python-gevent \ python-ldap \ @@ -27,7 +28,10 @@ RUN set -x; \ # install latest postgresql-client RUN set -x; \ echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' > etc/apt/sources.list.d/pgdg.list \ - && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ + && export GNUPGHOME="$(mktemp -d)" \ + && gpg --batch --keyserver keyserver.ubuntu.com --recv-keys ACCC4CF8 \ + && gpg --armor --export ACCC4CF8 | apt-key add - \ + && rm -rf "$GNUPGHOME" \ && apt-get update \ && apt-get install -y postgresql-client diff --git a/11.0/Dockerfile b/11.0/Dockerfile index 328aa18..1b3f376 100644 --- a/11.0/Dockerfile +++ b/11.0/Dockerfile @@ -10,6 +10,7 @@ RUN set -x; \ && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ + dirmngr \ fonts-noto-cjk \ gnupg \ libssl1.0-dev \ @@ -31,7 +32,11 @@ RUN set -x; \ # install latest postgresql-client RUN set -x; \ echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' > etc/apt/sources.list.d/pgdg.list \ - && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ + && export GNUPGHOME="$(mktemp -d)" \ + && gpg --batch --keyserver keyserver.ubuntu.com --recv-keys ACCC4CF8 \ + && gpg --armor --export ACCC4CF8 | apt-key add - \ + && gpgconf --kill all \ + && rm -rf "$GNUPGHOME" \ && apt-get update \ && apt-get install -y postgresql-client diff --git a/12.0/Dockerfile b/12.0/Dockerfile index 3c24fdc..380a7bf 100644 --- a/12.0/Dockerfile +++ b/12.0/Dockerfile @@ -10,6 +10,7 @@ RUN set -x; \ && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ + dirmngr \ fonts-noto-cjk \ gnupg \ libssl1.0-dev \ @@ -31,14 +32,22 @@ RUN set -x; \ # install latest postgresql-client RUN set -x; \ echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' > etc/apt/sources.list.d/pgdg.list \ - && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ + && export GNUPGHOME="$(mktemp -d)" \ + && gpg --batch --keyserver keyserver.ubuntu.com --recv-keys ACCC4CF8 \ + && gpg --armor --export ACCC4CF8 | apt-key add - \ + && gpgconf --kill all \ + && rm -rf "$GNUPGHOME" \ && apt-get update \ && apt-get install -y postgresql-client # Install rtlcss (on Debian stretch) RUN set -x;\ - curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \ - && echo "deb http://deb.nodesource.com/node_8.x stretch main" > /etc/apt/sources.list.d/nodesource.list \ + echo "deb http://deb.nodesource.com/node_8.x stretch main" > /etc/apt/sources.list.d/nodesource.list \ + && export GNUPGHOME="$(mktemp -d)" \ + && gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 68576280 \ + && gpg --armor --export 68576280 | apt-key add - \ + && gpgconf --kill all \ + && rm -rf "$GNUPGHOME" \ && apt-get update \ && apt-get install -y nodejs \ && npm install -g rtlcss From d3e44ad1f340ceb42ec73c2be5b2d65042fe7a52 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Thu, 31 Jan 2019 17:18:17 +0100 Subject: [PATCH 10/24] [FIX] Odoo 10.0-12.0: use long ID's for gpg keys Use long gpg ID's to avoid collisions. --- 10.0/Dockerfile | 8 +++++--- 11.0/Dockerfile | 8 +++++--- 12.0/Dockerfile | 16 ++++++++++------ 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/10.0/Dockerfile b/10.0/Dockerfile index dabd05a..99d118c 100644 --- a/10.0/Dockerfile +++ b/10.0/Dockerfile @@ -29,11 +29,13 @@ RUN set -x; \ RUN set -x; \ echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' > etc/apt/sources.list.d/pgdg.list \ && export GNUPGHOME="$(mktemp -d)" \ - && gpg --batch --keyserver keyserver.ubuntu.com --recv-keys ACCC4CF8 \ - && gpg --armor --export ACCC4CF8 | apt-key add - \ + && repokey='B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8' \ + && gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "${repokey}" \ + && gpg --armor --export "${repokey}" | apt-key add - \ && rm -rf "$GNUPGHOME" \ && apt-get update \ - && apt-get install -y postgresql-client + && apt-get install -y postgresql-client \ + && rm -rf /var/lib/apt/lists/* # Install Odoo ENV ODOO_VERSION 10.0 diff --git a/11.0/Dockerfile b/11.0/Dockerfile index 1b3f376..af1ba80 100644 --- a/11.0/Dockerfile +++ b/11.0/Dockerfile @@ -33,12 +33,14 @@ RUN set -x; \ RUN set -x; \ echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' > etc/apt/sources.list.d/pgdg.list \ && export GNUPGHOME="$(mktemp -d)" \ - && gpg --batch --keyserver keyserver.ubuntu.com --recv-keys ACCC4CF8 \ - && gpg --armor --export ACCC4CF8 | apt-key add - \ + && repokey='B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8' \ + && gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "${repokey}" \ + && gpg --armor --export "${repokey}" | apt-key add - \ && gpgconf --kill all \ && rm -rf "$GNUPGHOME" \ && apt-get update \ - && apt-get install -y postgresql-client + && apt-get install -y postgresql-client \ + && rm -rf /var/lib/apt/lists/* # Install Odoo ENV ODOO_VERSION 11.0 diff --git a/12.0/Dockerfile b/12.0/Dockerfile index 380a7bf..b9ba03a 100644 --- a/12.0/Dockerfile +++ b/12.0/Dockerfile @@ -33,24 +33,28 @@ RUN set -x; \ RUN set -x; \ echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' > etc/apt/sources.list.d/pgdg.list \ && export GNUPGHOME="$(mktemp -d)" \ - && gpg --batch --keyserver keyserver.ubuntu.com --recv-keys ACCC4CF8 \ - && gpg --armor --export ACCC4CF8 | apt-key add - \ + && repokey='B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8' \ + && gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "${repokey}" \ + && gpg --armor --export "${repokey}" | apt-key add - \ && gpgconf --kill all \ && rm -rf "$GNUPGHOME" \ && apt-get update \ - && apt-get install -y postgresql-client + && apt-get install -y postgresql-client \ + && rm -rf /var/lib/apt/lists/* # Install rtlcss (on Debian stretch) RUN set -x;\ echo "deb http://deb.nodesource.com/node_8.x stretch main" > /etc/apt/sources.list.d/nodesource.list \ && export GNUPGHOME="$(mktemp -d)" \ - && gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 68576280 \ - && gpg --armor --export 68576280 | apt-key add - \ + && repokey='9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280' \ + && gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "${repokey}" \ + && gpg --armor --export "${repokey}" | apt-key add - \ && gpgconf --kill all \ && rm -rf "$GNUPGHOME" \ && apt-get update \ && apt-get install -y nodejs \ - && npm install -g rtlcss + && npm install -g rtlcss \ + && rm -rf /var/lib/apt/lists/* # Install Odoo ENV ODOO_VERSION 12.0 From c6b79809f0772c419f681889b810ae4aaff8ec37 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Wed, 24 Apr 2019 17:01:17 +0200 Subject: [PATCH 11/24] [REF] Odoo 10.0-12.0: update to release 20190424 --- 10.0/Dockerfile | 4 ++-- 11.0/Dockerfile | 4 ++-- 12.0/Dockerfile | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/10.0/Dockerfile b/10.0/Dockerfile index 99d118c..6f03eb6 100644 --- a/10.0/Dockerfile +++ b/10.0/Dockerfile @@ -39,8 +39,8 @@ RUN set -x; \ # Install Odoo ENV ODOO_VERSION 10.0 -ARG ODOO_RELEASE=20190128 -ARG ODOO_SHA=673bb5e45c006c9a822a0ca1a7d19989c03151ad +ARG ODOO_RELEASE=20190424 +ARG ODOO_SHA=1f4668c0e3b1597ffa931994952cf6fce87df37e RUN set -x; \ curl -o odoo.deb -sSL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ && echo "${ODOO_SHA} odoo.deb" | sha1sum -c - \ diff --git a/11.0/Dockerfile b/11.0/Dockerfile index af1ba80..2854505 100644 --- a/11.0/Dockerfile +++ b/11.0/Dockerfile @@ -44,8 +44,8 @@ RUN set -x; \ # Install Odoo ENV ODOO_VERSION 11.0 -ARG ODOO_RELEASE=20190128 -ARG ODOO_SHA=30cb83ce38ec0b4a459e5590407cb2f9dcf46061 +ARG ODOO_RELEASE=20190424 +ARG ODOO_SHA=374ccf1d4cde0e73d79f970ef75188c78ee0e222 RUN set -x; \ curl -o odoo.deb -sSL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ && echo "${ODOO_SHA} odoo.deb" | sha1sum -c - \ diff --git a/12.0/Dockerfile b/12.0/Dockerfile index b9ba03a..1098831 100644 --- a/12.0/Dockerfile +++ b/12.0/Dockerfile @@ -58,8 +58,8 @@ RUN set -x;\ # Install Odoo ENV ODOO_VERSION 12.0 -ARG ODOO_RELEASE=20190128 -ARG ODOO_SHA=9e34aaed2eb1e7697aaf36767247dbf335e9fe7a +ARG ODOO_RELEASE=20190424 +ARG ODOO_SHA=3885be6791b9b8c2a74115299e57213c71db4363 RUN set -x; \ curl -o odoo.deb -sSL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ && echo "${ODOO_SHA} odoo.deb" | sha1sum -c - \ From b5f088de13927177263d6cbc5ebf7d39de4dcfa7 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Fri, 16 Aug 2019 14:14:44 +0200 Subject: [PATCH 12/24] [REF] Odoo 10.0-12.0: update to release 20190816 --- 10.0/Dockerfile | 4 ++-- 11.0/Dockerfile | 4 ++-- 12.0/Dockerfile | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/10.0/Dockerfile b/10.0/Dockerfile index 6f03eb6..f334fe5 100644 --- a/10.0/Dockerfile +++ b/10.0/Dockerfile @@ -39,8 +39,8 @@ RUN set -x; \ # Install Odoo ENV ODOO_VERSION 10.0 -ARG ODOO_RELEASE=20190424 -ARG ODOO_SHA=1f4668c0e3b1597ffa931994952cf6fce87df37e +ARG ODOO_RELEASE=20190816 +ARG ODOO_SHA=397cb4d458cb292edb0432dc8d39a466dce56b65 RUN set -x; \ curl -o odoo.deb -sSL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ && echo "${ODOO_SHA} odoo.deb" | sha1sum -c - \ diff --git a/11.0/Dockerfile b/11.0/Dockerfile index 2854505..4f6b930 100644 --- a/11.0/Dockerfile +++ b/11.0/Dockerfile @@ -44,8 +44,8 @@ RUN set -x; \ # Install Odoo ENV ODOO_VERSION 11.0 -ARG ODOO_RELEASE=20190424 -ARG ODOO_SHA=374ccf1d4cde0e73d79f970ef75188c78ee0e222 +ARG ODOO_RELEASE=20190816 +ARG ODOO_SHA=948e097925bfbba8ffd9682c2d0555dc9b539c0a RUN set -x; \ curl -o odoo.deb -sSL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ && echo "${ODOO_SHA} odoo.deb" | sha1sum -c - \ diff --git a/12.0/Dockerfile b/12.0/Dockerfile index 1098831..a983e42 100644 --- a/12.0/Dockerfile +++ b/12.0/Dockerfile @@ -58,8 +58,8 @@ RUN set -x;\ # Install Odoo ENV ODOO_VERSION 12.0 -ARG ODOO_RELEASE=20190424 -ARG ODOO_SHA=3885be6791b9b8c2a74115299e57213c71db4363 +ARG ODOO_RELEASE=20190816 +ARG ODOO_SHA=e95cdfe23d16a8572b63bc8d8e8616be5bc18a0a RUN set -x; \ curl -o odoo.deb -sSL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ && echo "${ODOO_SHA} odoo.deb" | sha1sum -c - \ From b32f2033d1e2bc2ca501eac0b4df79cd49632de7 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Tue, 8 Oct 2019 08:35:11 +0200 Subject: [PATCH 13/24] [REM] Odoo 10.0: remove deprecated version --- 10.0/Dockerfile | 72 ---------------------------------------------- 10.0/entrypoint.sh | 42 --------------------------- 10.0/odoo.conf | 37 ------------------------ 3 files changed, 151 deletions(-) delete mode 100644 10.0/Dockerfile delete mode 100755 10.0/entrypoint.sh delete mode 100644 10.0/odoo.conf diff --git a/10.0/Dockerfile b/10.0/Dockerfile deleted file mode 100644 index f334fe5..0000000 --- a/10.0/Dockerfile +++ /dev/null @@ -1,72 +0,0 @@ -FROM debian:jessie -LABEL maintainer="Odoo S.A. " - -# Install some deps, lessc and less-plugin-clean-css, and wkhtmltopdf -RUN set -x; \ - apt-get update \ - && apt-get install -y --no-install-recommends \ - ca-certificates \ - curl \ - dirmngr \ - node-less \ - python-gevent \ - python-ldap \ - python-pip \ - python-qrcode \ - python-renderpm \ - python-support \ - python-vobject \ - python-watchdog \ - && curl -o wkhtmltox.deb -sSL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.jessie_amd64.deb \ - && echo '4d104ff338dc2d2083457b3b1e9baab8ddf14202 wkhtmltox.deb' | sha1sum -c - \ - && dpkg --force-depends -i wkhtmltox.deb \ - && apt-get -y install -f --no-install-recommends \ - && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false npm \ - && rm -rf /var/lib/apt/lists/* wkhtmltox.deb \ - && pip install psycogreen==1.0 - -# install latest postgresql-client -RUN set -x; \ - echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' > etc/apt/sources.list.d/pgdg.list \ - && export GNUPGHOME="$(mktemp -d)" \ - && repokey='B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8' \ - && gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "${repokey}" \ - && gpg --armor --export "${repokey}" | apt-key add - \ - && rm -rf "$GNUPGHOME" \ - && apt-get update \ - && apt-get install -y postgresql-client \ - && rm -rf /var/lib/apt/lists/* - -# Install Odoo -ENV ODOO_VERSION 10.0 -ARG ODOO_RELEASE=20190816 -ARG ODOO_SHA=397cb4d458cb292edb0432dc8d39a466dce56b65 -RUN set -x; \ - curl -o odoo.deb -sSL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ - && echo "${ODOO_SHA} odoo.deb" | sha1sum -c - \ - && dpkg --force-depends -i odoo.deb \ - && apt-get update \ - && apt-get -y install -f --no-install-recommends \ - && rm -rf /var/lib/apt/lists/* odoo.deb - -# Copy entrypoint script and Odoo configuration file -COPY ./entrypoint.sh / -COPY ./odoo.conf /etc/odoo/ -RUN chown odoo /etc/odoo/odoo.conf - -# Mount /var/lib/odoo to allow restoring filestore and /mnt/extra-addons for users addons -RUN mkdir -p /mnt/extra-addons \ - && chown -R odoo /mnt/extra-addons -VOLUME ["/var/lib/odoo", "/mnt/extra-addons"] - -# Expose Odoo services -EXPOSE 8069 8071 - -# Set the default config file -ENV ODOO_RC /etc/odoo/odoo.conf - -# Set default user when running the container -USER odoo - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["odoo"] diff --git a/10.0/entrypoint.sh b/10.0/entrypoint.sh deleted file mode 100755 index 4f0ef59..0000000 --- a/10.0/entrypoint.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -set -e - -# set the postgres database host, port, user and password according to the environment -# and pass them as arguments to the odoo process if not present in the config file -: ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}} -: ${PORT:=${DB_PORT_5432_TCP_PORT:=5432}} -: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}} -: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}} - -DB_ARGS=() -function check_config() { - param="$1" - value="$2" - if ! grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then - DB_ARGS+=("--${param}") - DB_ARGS+=("${value}") - fi; -} -check_config "db_host" "$HOST" -check_config "db_port" "$PORT" -check_config "db_user" "$USER" -check_config "db_password" "$PASSWORD" - -case "$1" in - -- | odoo) - shift - if [[ "$1" == "scaffold" ]] ; then - exec odoo "$@" - else - exec odoo "$@" "${DB_ARGS[@]}" - fi - ;; - -*) - exec odoo "$@" "${DB_ARGS[@]}" - ;; - *) - exec "$@" -esac - -exit 1 diff --git a/10.0/odoo.conf b/10.0/odoo.conf deleted file mode 100644 index c3769ce..0000000 --- a/10.0/odoo.conf +++ /dev/null @@ -1,37 +0,0 @@ -[options] -addons_path = /mnt/extra-addons,/usr/lib/python2.7/dist-packages/odoo/addons -data_dir = /var/lib/odoo -; admin_passwd = admin -; csv_internal_sep = , -; db_maxconn = 64 -; db_name = False -; db_template = template1 -; dbfilter = .* -; debug_mode = False -; email_from = False -; limit_memory_hard = 2684354560 -; limit_memory_soft = 2147483648 -; limit_request = 8192 -; limit_time_cpu = 60 -; limit_time_real = 120 -; list_db = True -; log_db = False -; log_handler = [':INFO'] -; log_level = info -; logfile = None -; longpolling_port = 8072 -; max_cron_threads = 2 -; osv_memory_age_limit = 1.0 -; osv_memory_count_limit = False -; smtp_password = False -; smtp_port = 25 -; smtp_server = localhost -; smtp_ssl = False -; smtp_user = False -; workers = 0 -; xmlrpc = True -; xmlrpc_interface = -; xmlrpc_port = 8069 -; xmlrpcs = True -; xmlrpcs_interface = -; xmlrpcs_port = 8071 From 6e7938ab6a5ebfb795433dc523b7121d1d9042d3 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Wed, 9 Oct 2019 13:30:39 +0200 Subject: [PATCH 14/24] [ADD] Odoo: 13.0 * Add Odoo version 13.0 release 20191009 --- 13.0/Dockerfile | 83 ++++++++++++++++++++++++++++++++++++++++++++++ 13.0/entrypoint.sh | 42 +++++++++++++++++++++++ 13.0/odoo.conf | 37 +++++++++++++++++++++ 3 files changed, 162 insertions(+) create mode 100644 13.0/Dockerfile create mode 100755 13.0/entrypoint.sh create mode 100644 13.0/odoo.conf diff --git a/13.0/Dockerfile b/13.0/Dockerfile new file mode 100644 index 0000000..52efac9 --- /dev/null +++ b/13.0/Dockerfile @@ -0,0 +1,83 @@ +FROM debian:buster +LABEL maintainer="Odoo S.A. " + +# Generate locale C.UTF-8 for postgres and general locale data +ENV LANG C.UTF-8 + +# Install some deps, lessc and less-plugin-clean-css, and wkhtmltopdf +RUN set -x; \ + apt-get update \ + && apt-get install -y --no-install-recommends \ + ca-certificates \ + curl \ + dirmngr \ + fonts-noto-cjk \ + gnupg \ + libssl-dev \ + node-less \ + npm \ + python3-pip \ + python3-pyldap \ + python3-qrcode \ + python3-renderpm \ + python3-setuptools \ + python3-vobject \ + python3-watchdog \ + 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 - \ + && dpkg --force-depends -i wkhtmltox.deb\ + && apt-get -y install -f --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* wkhtmltox.deb + +# install latest postgresql-client +RUN set -x; \ + echo 'deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main' > etc/apt/sources.list.d/pgdg.list \ + && export GNUPGHOME="$(mktemp -d)" \ + && repokey='B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8' \ + && gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "${repokey}" \ + && gpg --armor --export "${repokey}" | apt-key add - \ + && gpgconf --kill all \ + && rm -rf "$GNUPGHOME" \ + && apt-get update \ + && apt-get install -y postgresql-client \ + && rm -rf /var/lib/apt/lists/* + +# Install rtlcss (on Debian buster) +RUN set -x; \ + npm install -g rtlcss + +# Install Odoo +ENV ODOO_VERSION 13.0 +ARG ODOO_RELEASE=20191009 +ARG ODOO_SHA=468633ffd7ebacdde116e8708fd62f74788cd2b1 +RUN set -x; \ + curl -o odoo.deb -sSL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ + && echo "${ODOO_SHA} odoo.deb" | sha1sum -c - \ + && dpkg --force-depends -i odoo.deb \ + && apt-get update \ + && apt-get -y install -f --no-install-recommends \ + && 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 + +# Mount /var/lib/odoo to allow restoring filestore and /mnt/extra-addons for users addons +RUN mkdir -p /mnt/extra-addons \ + && chown -R odoo /mnt/extra-addons +VOLUME ["/var/lib/odoo", "/mnt/extra-addons"] + +# Expose Odoo services +EXPOSE 8069 8071 + +# Set the default config file +ENV ODOO_RC /etc/odoo/odoo.conf + +# Set default user when running the container +USER odoo + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["odoo"] diff --git a/13.0/entrypoint.sh b/13.0/entrypoint.sh new file mode 100755 index 0000000..4f0ef59 --- /dev/null +++ b/13.0/entrypoint.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +set -e + +# set the postgres database host, port, user and password according to the environment +# and pass them as arguments to the odoo process if not present in the config file +: ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}} +: ${PORT:=${DB_PORT_5432_TCP_PORT:=5432}} +: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}} +: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}} + +DB_ARGS=() +function check_config() { + param="$1" + value="$2" + if ! grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then + DB_ARGS+=("--${param}") + DB_ARGS+=("${value}") + fi; +} +check_config "db_host" "$HOST" +check_config "db_port" "$PORT" +check_config "db_user" "$USER" +check_config "db_password" "$PASSWORD" + +case "$1" in + -- | odoo) + shift + if [[ "$1" == "scaffold" ]] ; then + exec odoo "$@" + else + exec odoo "$@" "${DB_ARGS[@]}" + fi + ;; + -*) + exec odoo "$@" "${DB_ARGS[@]}" + ;; + *) + exec "$@" +esac + +exit 1 diff --git a/13.0/odoo.conf b/13.0/odoo.conf new file mode 100644 index 0000000..28f70c1 --- /dev/null +++ b/13.0/odoo.conf @@ -0,0 +1,37 @@ +[options] +addons_path = /mnt/extra-addons +data_dir = /var/lib/odoo +; admin_passwd = admin +; csv_internal_sep = , +; db_maxconn = 64 +; db_name = False +; db_template = template1 +; dbfilter = .* +; debug_mode = False +; email_from = False +; limit_memory_hard = 2684354560 +; limit_memory_soft = 2147483648 +; limit_request = 8192 +; limit_time_cpu = 60 +; limit_time_real = 120 +; list_db = True +; log_db = False +; log_handler = [':INFO'] +; log_level = info +; logfile = None +; longpolling_port = 8072 +; max_cron_threads = 2 +; osv_memory_age_limit = 1.0 +; osv_memory_count_limit = False +; smtp_password = False +; smtp_port = 25 +; smtp_server = localhost +; smtp_ssl = False +; smtp_user = False +; workers = 0 +; xmlrpc = True +; xmlrpc_interface = +; xmlrpc_port = 8069 +; xmlrpcs = True +; xmlrpcs_interface = +; xmlrpcs_port = 8071 From 06604959547561e417b400341a3501d36cc7c8a0 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Wed, 9 Oct 2019 14:25:48 +0200 Subject: [PATCH 15/24] [REF] Odoo 11.0-12.0: update to release 20191009 --- 11.0/Dockerfile | 4 ++-- 12.0/Dockerfile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/11.0/Dockerfile b/11.0/Dockerfile index 4f6b930..3dc65d6 100644 --- a/11.0/Dockerfile +++ b/11.0/Dockerfile @@ -44,8 +44,8 @@ RUN set -x; \ # Install Odoo ENV ODOO_VERSION 11.0 -ARG ODOO_RELEASE=20190816 -ARG ODOO_SHA=948e097925bfbba8ffd9682c2d0555dc9b539c0a +ARG ODOO_RELEASE=20191009 +ARG ODOO_SHA=20f17b7c6c7206cc799c652964d09d4a27a22715 RUN set -x; \ curl -o odoo.deb -sSL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ && echo "${ODOO_SHA} odoo.deb" | sha1sum -c - \ diff --git a/12.0/Dockerfile b/12.0/Dockerfile index a983e42..0b643ec 100644 --- a/12.0/Dockerfile +++ b/12.0/Dockerfile @@ -58,8 +58,8 @@ RUN set -x;\ # Install Odoo ENV ODOO_VERSION 12.0 -ARG ODOO_RELEASE=20190816 -ARG ODOO_SHA=e95cdfe23d16a8572b63bc8d8e8616be5bc18a0a +ARG ODOO_RELEASE=20191009 +ARG ODOO_SHA=5f3623139c43c71b11dca6a87aaa0def0cf865d8 RUN set -x; \ curl -o odoo.deb -sSL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ && echo "${ODOO_SHA} odoo.deb" | sha1sum -c - \ From 6ba07c93c397b64825c8d0ba0c46cd24c3155f42 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Thu, 10 Oct 2019 17:03:46 +0200 Subject: [PATCH 16/24] [FIX] 11.0-13.0: remove deprecated label usage --- 11.0/Dockerfile | 2 +- 12.0/Dockerfile | 2 +- 13.0/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/11.0/Dockerfile b/11.0/Dockerfile index 3dc65d6..99421e3 100644 --- a/11.0/Dockerfile +++ b/11.0/Dockerfile @@ -1,5 +1,5 @@ FROM debian:stretch -LABEL maintainer="Odoo S.A. " +MAINTAINER Odoo S.A. # Generate locale C.UTF-8 for postgres and general locale data ENV LANG C.UTF-8 diff --git a/12.0/Dockerfile b/12.0/Dockerfile index 0b643ec..cb96a8d 100644 --- a/12.0/Dockerfile +++ b/12.0/Dockerfile @@ -1,5 +1,5 @@ FROM debian:stretch -LABEL maintainer="Odoo S.A. " +MAINTAINER Odoo S.A. # Generate locale C.UTF-8 for postgres and general locale data ENV LANG C.UTF-8 diff --git a/13.0/Dockerfile b/13.0/Dockerfile index 52efac9..4dc24e4 100644 --- a/13.0/Dockerfile +++ b/13.0/Dockerfile @@ -1,5 +1,5 @@ FROM debian:buster -LABEL maintainer="Odoo S.A. " +MAINTAINER Odoo S.A. # Generate locale C.UTF-8 for postgres and general locale data ENV LANG C.UTF-8 From 9409487426e5556f31bb1293ba63b6138d53cfe8 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Wed, 9 Oct 2019 14:25:19 +0200 Subject: [PATCH 17/24] [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 From c1fbc53720789928437cfc0caedc3cf894e98765 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Thu, 10 Oct 2019 16:49:31 +0200 Subject: [PATCH 18/24] [FIX] 11.0-13.0: use gpg batch mode Without batch option, gpg may try to use /dev/tty. See https://bugs.debian.org/913614 --- 11.0/Dockerfile | 2 +- 12.0/Dockerfile | 4 ++-- 13.0/Dockerfile | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/11.0/Dockerfile b/11.0/Dockerfile index aca47f4..706c996 100644 --- a/11.0/Dockerfile +++ b/11.0/Dockerfile @@ -41,7 +41,7 @@ RUN set -x; \ && export GNUPGHOME="$(mktemp -d)" \ && repokey='B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8' \ && gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "${repokey}" \ - && gpg --armor --export "${repokey}" | apt-key add - \ + && gpg --batch --armor --export "${repokey}" > /etc/apt/trusted.gpg.d/pgdg.gpg.asc \ && gpgconf --kill all \ && rm -rf "$GNUPGHOME" \ && apt-get update \ diff --git a/12.0/Dockerfile b/12.0/Dockerfile index 3442b53..60f7736 100644 --- a/12.0/Dockerfile +++ b/12.0/Dockerfile @@ -41,7 +41,7 @@ RUN set -x; \ && export GNUPGHOME="$(mktemp -d)" \ && repokey='B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8' \ && gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "${repokey}" \ - && gpg --armor --export "${repokey}" | apt-key add - \ + && gpg --batch --armor --export "${repokey}" > /etc/apt/trusted.gpg.d/pgdg.gpg.asc \ && gpgconf --kill all \ && rm -rf "$GNUPGHOME" \ && apt-get update \ @@ -54,7 +54,7 @@ RUN set -x;\ && export GNUPGHOME="$(mktemp -d)" \ && repokey='9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280' \ && gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "${repokey}" \ - && gpg --armor --export "${repokey}" | apt-key add - \ + && gpg --batch --armor --export "${repokey}" > /etc/apt/trusted.gpg.d/nodejs.gpg.asc \ && gpgconf --kill all \ && rm -rf "$GNUPGHOME" \ && apt-get update \ diff --git a/13.0/Dockerfile b/13.0/Dockerfile index e5525d0..0347590 100644 --- a/13.0/Dockerfile +++ b/13.0/Dockerfile @@ -39,7 +39,7 @@ RUN set -x; \ && export GNUPGHOME="$(mktemp -d)" \ && repokey='B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8' \ && gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "${repokey}" \ - && gpg --armor --export "${repokey}" | apt-key add - \ + && gpg --batch --armor --export "${repokey}" > /etc/apt/trusted.gpg.d/pgdg.gpg.asc \ && gpgconf --kill all \ && rm -rf "$GNUPGHOME" \ && apt-get update \ From f126d72f664e1844ce35bf46b7b43a46d56e3fd5 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Thu, 10 Oct 2019 16:52:15 +0200 Subject: [PATCH 19/24] [FIX] 11.0-13.0: use apt-get to install wkhtmltopdf Usage of apt-get should prevent installing wkhtmltopdf on wrong architecture. --- 11.0/Dockerfile | 3 +-- 12.0/Dockerfile | 3 +-- 13.0/Dockerfile | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/11.0/Dockerfile b/11.0/Dockerfile index 706c996..f8f56c8 100644 --- a/11.0/Dockerfile +++ b/11.0/Dockerfile @@ -31,8 +31,7 @@ RUN set -x; \ 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 - \ - && dpkg --force-depends -i wkhtmltox.deb\ - && apt-get -y install -f --no-install-recommends \ + && apt-get install -y --no-install-recommends ./wkhtmltox.deb \ && rm -rf /var/lib/apt/lists/* wkhtmltox.deb # install latest postgresql-client diff --git a/12.0/Dockerfile b/12.0/Dockerfile index 60f7736..8103ab6 100644 --- a/12.0/Dockerfile +++ b/12.0/Dockerfile @@ -31,8 +31,7 @@ RUN set -x; \ 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 - \ - && dpkg --force-depends -i wkhtmltox.deb\ - && apt-get -y install -f --no-install-recommends \ + && apt-get install -y --no-install-recommends ./wkhtmltox.deb \ && rm -rf /var/lib/apt/lists/* wkhtmltox.deb # install latest postgresql-client diff --git a/13.0/Dockerfile b/13.0/Dockerfile index 0347590..44d25bd 100644 --- a/13.0/Dockerfile +++ b/13.0/Dockerfile @@ -29,8 +29,7 @@ RUN set -x; \ 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 - \ - && dpkg --force-depends -i wkhtmltox.deb\ - && apt-get -y install -f --no-install-recommends \ + && apt-get install -y --no-install-recommends ./wkhtmltox.deb \ && rm -rf /var/lib/apt/lists/* wkhtmltox.deb # install latest postgresql-client From 14e51ae334564952c8e07b047351eabfaeee5bb9 Mon Sep 17 00:00:00 2001 From: rbuisson Date: Tue, 16 Jul 2019 15:16:04 +0200 Subject: [PATCH 20/24] [IMP] 11.0-13.0: Wait for PostgreSQL before starting Odoo In some situations, like when a docker compose file use a data volume to persist postgresql databases, the Odoo server starts and tries to connect to database server before the postgresql server is ready. In such a case, the Odoo containers fails to start. With this commit, the wait-for-it script is used to wait for the database server service to be ready before starting Odoo. This script is available as a Debian package. Closes #258, closes #259 --- 11.0/Dockerfile | 1 + 11.0/entrypoint.sh | 3 +++ 12.0/Dockerfile | 1 + 12.0/entrypoint.sh | 3 +++ 13.0/Dockerfile | 1 + 13.0/entrypoint.sh | 3 +++ 6 files changed, 12 insertions(+) diff --git a/11.0/Dockerfile b/11.0/Dockerfile index f8f56c8..080e08d 100644 --- a/11.0/Dockerfile +++ b/11.0/Dockerfile @@ -13,6 +13,7 @@ RUN set -x; \ && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ + wait-for-it \ dirmngr \ fonts-noto-cjk \ gnupg \ diff --git a/11.0/entrypoint.sh b/11.0/entrypoint.sh index 4f0ef59..b6401f7 100755 --- a/11.0/entrypoint.sh +++ b/11.0/entrypoint.sh @@ -23,6 +23,9 @@ check_config "db_port" "$PORT" check_config "db_user" "$USER" check_config "db_password" "$PASSWORD" +# Wait for the database to be up +wait-for-it $HOST:$PORT --timeout=60 -- sleep 5s + case "$1" in -- | odoo) shift diff --git a/12.0/Dockerfile b/12.0/Dockerfile index 8103ab6..6f8f85f 100644 --- a/12.0/Dockerfile +++ b/12.0/Dockerfile @@ -13,6 +13,7 @@ RUN set -x; \ && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ + wait-for-it \ dirmngr \ fonts-noto-cjk \ gnupg \ diff --git a/12.0/entrypoint.sh b/12.0/entrypoint.sh index 4f0ef59..b6401f7 100755 --- a/12.0/entrypoint.sh +++ b/12.0/entrypoint.sh @@ -23,6 +23,9 @@ check_config "db_port" "$PORT" check_config "db_user" "$USER" check_config "db_password" "$PASSWORD" +# Wait for the database to be up +wait-for-it $HOST:$PORT --timeout=60 -- sleep 5s + case "$1" in -- | odoo) shift diff --git a/13.0/Dockerfile b/13.0/Dockerfile index 44d25bd..ea22d90 100644 --- a/13.0/Dockerfile +++ b/13.0/Dockerfile @@ -10,6 +10,7 @@ RUN set -x; \ && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ + wait-for-it \ dirmngr \ fonts-noto-cjk \ gnupg \ diff --git a/13.0/entrypoint.sh b/13.0/entrypoint.sh index 4f0ef59..b6401f7 100755 --- a/13.0/entrypoint.sh +++ b/13.0/entrypoint.sh @@ -23,6 +23,9 @@ check_config "db_port" "$PORT" check_config "db_user" "$USER" check_config "db_password" "$PASSWORD" +# Wait for the database to be up +wait-for-it $HOST:$PORT --timeout=60 -- sleep 5s + case "$1" in -- | odoo) shift From 19c672588152e953258dc59270ef06685f243d0f Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Tue, 22 Oct 2019 13:26:30 +0200 Subject: [PATCH 21/24] [REF] Odoo 11.0-13.0: update to release 20191022 --- 11.0/Dockerfile | 4 ++-- 12.0/Dockerfile | 4 ++-- 13.0/Dockerfile | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/11.0/Dockerfile b/11.0/Dockerfile index 080e08d..361c76a 100644 --- a/11.0/Dockerfile +++ b/11.0/Dockerfile @@ -50,8 +50,8 @@ RUN set -x; \ # Install Odoo ENV ODOO_VERSION 11.0 -ARG ODOO_RELEASE=20191009 -ARG ODOO_SHA=20f17b7c6c7206cc799c652964d09d4a27a22715 +ARG ODOO_RELEASE=20191022 +ARG ODOO_SHA=eea3333a3d7402c4ff63a09d9da145a6a4a3bab2 RUN set -x; \ curl -o odoo.deb -sSL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ && echo "${ODOO_SHA} odoo.deb" | sha1sum -c - \ diff --git a/12.0/Dockerfile b/12.0/Dockerfile index 6f8f85f..cfa69a6 100644 --- a/12.0/Dockerfile +++ b/12.0/Dockerfile @@ -64,8 +64,8 @@ RUN set -x;\ # Install Odoo ENV ODOO_VERSION 12.0 -ARG ODOO_RELEASE=20191009 -ARG ODOO_SHA=5f3623139c43c71b11dca6a87aaa0def0cf865d8 +ARG ODOO_RELEASE=20191022 +ARG ODOO_SHA=31cdde4a9f6cd9d2cbf6af45a5d301e0a0907148 RUN set -x; \ curl -o odoo.deb -sSL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ && echo "${ODOO_SHA} odoo.deb" | sha1sum -c - \ diff --git a/13.0/Dockerfile b/13.0/Dockerfile index ea22d90..7a1b3ff 100644 --- a/13.0/Dockerfile +++ b/13.0/Dockerfile @@ -52,8 +52,8 @@ RUN set -x; \ # Install Odoo ENV ODOO_VERSION 13.0 -ARG ODOO_RELEASE=20191009 -ARG ODOO_SHA=468633ffd7ebacdde116e8708fd62f74788cd2b1 +ARG ODOO_RELEASE=20191022 +ARG ODOO_SHA=09eb205ed1e4348dd4762263cafa9819e17dba7e RUN set -x; \ curl -o odoo.deb -sSL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ && echo "${ODOO_SHA} odoo.deb" | sha1sum -c - \ From ffe62bdd52f88ac85f54064e6eb02aa38f88f58d Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Wed, 23 Oct 2019 15:35:01 +0200 Subject: [PATCH 22/24] [FIX] Odoo 11.0-12.0: replace wait-for-it script As the wait-for-it script is started before the parsing of the command line, it is always started. It can be a problem if a user wants to start some other binary than odoo (for example a shell). Also, the wait-for-it script is only checking if a port is open on a host and then waits 5 seconds before starting Odoo. With this commit, the wait-for-it script is replaced by a more useful custom python script that checks if the postgresql server is able to handle a connection with the given parameters. Odoo then starts whenever it's ready or fails after a 30 sec timeout. --- 11.0/Dockerfile | 3 ++- 11.0/entrypoint.sh | 5 ++--- 11.0/wait-for-psql.py | 32 ++++++++++++++++++++++++++++++++ 12.0/Dockerfile | 3 ++- 12.0/entrypoint.sh | 5 ++--- 12.0/wait-for-psql.py | 32 ++++++++++++++++++++++++++++++++ 13.0/Dockerfile | 3 ++- 13.0/entrypoint.sh | 5 ++--- 13.0/wait-for-psql.py | 32 ++++++++++++++++++++++++++++++++ 9 files changed, 108 insertions(+), 12 deletions(-) create mode 100755 11.0/wait-for-psql.py create mode 100755 12.0/wait-for-psql.py create mode 100755 13.0/wait-for-psql.py diff --git a/11.0/Dockerfile b/11.0/Dockerfile index 361c76a..6f84e46 100644 --- a/11.0/Dockerfile +++ b/11.0/Dockerfile @@ -13,7 +13,6 @@ RUN set -x; \ && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ - wait-for-it \ dirmngr \ fonts-noto-cjk \ gnupg \ @@ -76,6 +75,8 @@ EXPOSE 8069 8071 # Set the default config file ENV ODOO_RC /etc/odoo/odoo.conf +COPY wait-for-psql.py /usr/local/bin/wait-for-psql.py + # Set default user when running the container USER odoo diff --git a/11.0/entrypoint.sh b/11.0/entrypoint.sh index b6401f7..5638e6d 100755 --- a/11.0/entrypoint.sh +++ b/11.0/entrypoint.sh @@ -23,19 +23,18 @@ check_config "db_port" "$PORT" check_config "db_user" "$USER" check_config "db_password" "$PASSWORD" -# Wait for the database to be up -wait-for-it $HOST:$PORT --timeout=60 -- sleep 5s - case "$1" in -- | odoo) shift if [[ "$1" == "scaffold" ]] ; then exec odoo "$@" else + wait-for-psql.py ${DB_ARGS[@]} --timeout=30 exec odoo "$@" "${DB_ARGS[@]}" fi ;; -*) + wait-for-psql.py ${DB_ARGS[@]} --timeout=30 exec odoo "$@" "${DB_ARGS[@]}" ;; *) diff --git a/11.0/wait-for-psql.py b/11.0/wait-for-psql.py new file mode 100755 index 0000000..a55f440 --- /dev/null +++ b/11.0/wait-for-psql.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 +import argparse +import psycopg2 +import sys +import time + + +if __name__ == '__main__': + arg_parser = argparse.ArgumentParser() + arg_parser.add_argument('--db_host', required=True) + arg_parser.add_argument('--db_port', required=True) + arg_parser.add_argument('--db_user', required=True) + arg_parser.add_argument('--db_password', required=True) + arg_parser.add_argument('--timeout', type=int, default=5) + + args = arg_parser.parse_args() + + start_time = time.time() + while (time.time() - start_time) < args.timeout: + try: + conn = psycopg2.connect(user=args.db_user, host=args.db_host, port=args.db_port, password=args.db_password, dbname='postgres') + error = '' + break + except psycopg2.OperationalError as e: + error = e + else: + conn.close() + time.sleep(1) + + if error: + print("Database connection failure: %s" % error, file=sys.stderr) + sys.exit(1) diff --git a/12.0/Dockerfile b/12.0/Dockerfile index cfa69a6..a93334a 100644 --- a/12.0/Dockerfile +++ b/12.0/Dockerfile @@ -13,7 +13,6 @@ RUN set -x; \ && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ - wait-for-it \ dirmngr \ fonts-noto-cjk \ gnupg \ @@ -90,6 +89,8 @@ EXPOSE 8069 8071 # Set the default config file ENV ODOO_RC /etc/odoo/odoo.conf +COPY wait-for-psql.py /usr/local/bin/wait-for-psql.py + # Set default user when running the container USER odoo diff --git a/12.0/entrypoint.sh b/12.0/entrypoint.sh index b6401f7..5638e6d 100755 --- a/12.0/entrypoint.sh +++ b/12.0/entrypoint.sh @@ -23,19 +23,18 @@ check_config "db_port" "$PORT" check_config "db_user" "$USER" check_config "db_password" "$PASSWORD" -# Wait for the database to be up -wait-for-it $HOST:$PORT --timeout=60 -- sleep 5s - case "$1" in -- | odoo) shift if [[ "$1" == "scaffold" ]] ; then exec odoo "$@" else + wait-for-psql.py ${DB_ARGS[@]} --timeout=30 exec odoo "$@" "${DB_ARGS[@]}" fi ;; -*) + wait-for-psql.py ${DB_ARGS[@]} --timeout=30 exec odoo "$@" "${DB_ARGS[@]}" ;; *) diff --git a/12.0/wait-for-psql.py b/12.0/wait-for-psql.py new file mode 100755 index 0000000..a55f440 --- /dev/null +++ b/12.0/wait-for-psql.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 +import argparse +import psycopg2 +import sys +import time + + +if __name__ == '__main__': + arg_parser = argparse.ArgumentParser() + arg_parser.add_argument('--db_host', required=True) + arg_parser.add_argument('--db_port', required=True) + arg_parser.add_argument('--db_user', required=True) + arg_parser.add_argument('--db_password', required=True) + arg_parser.add_argument('--timeout', type=int, default=5) + + args = arg_parser.parse_args() + + start_time = time.time() + while (time.time() - start_time) < args.timeout: + try: + conn = psycopg2.connect(user=args.db_user, host=args.db_host, port=args.db_port, password=args.db_password, dbname='postgres') + error = '' + break + except psycopg2.OperationalError as e: + error = e + else: + conn.close() + time.sleep(1) + + if error: + print("Database connection failure: %s" % error, file=sys.stderr) + sys.exit(1) diff --git a/13.0/Dockerfile b/13.0/Dockerfile index 7a1b3ff..d20372e 100644 --- a/13.0/Dockerfile +++ b/13.0/Dockerfile @@ -10,7 +10,6 @@ RUN set -x; \ && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ - wait-for-it \ dirmngr \ fonts-noto-cjk \ gnupg \ @@ -78,6 +77,8 @@ EXPOSE 8069 8071 # Set the default config file ENV ODOO_RC /etc/odoo/odoo.conf +COPY wait-for-psql.py /usr/local/bin/wait-for-psql.py + # Set default user when running the container USER odoo diff --git a/13.0/entrypoint.sh b/13.0/entrypoint.sh index b6401f7..5638e6d 100755 --- a/13.0/entrypoint.sh +++ b/13.0/entrypoint.sh @@ -23,19 +23,18 @@ check_config "db_port" "$PORT" check_config "db_user" "$USER" check_config "db_password" "$PASSWORD" -# Wait for the database to be up -wait-for-it $HOST:$PORT --timeout=60 -- sleep 5s - case "$1" in -- | odoo) shift if [[ "$1" == "scaffold" ]] ; then exec odoo "$@" else + wait-for-psql.py ${DB_ARGS[@]} --timeout=30 exec odoo "$@" "${DB_ARGS[@]}" fi ;; -*) + wait-for-psql.py ${DB_ARGS[@]} --timeout=30 exec odoo "$@" "${DB_ARGS[@]}" ;; *) diff --git a/13.0/wait-for-psql.py b/13.0/wait-for-psql.py new file mode 100755 index 0000000..a55f440 --- /dev/null +++ b/13.0/wait-for-psql.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 +import argparse +import psycopg2 +import sys +import time + + +if __name__ == '__main__': + arg_parser = argparse.ArgumentParser() + arg_parser.add_argument('--db_host', required=True) + arg_parser.add_argument('--db_port', required=True) + arg_parser.add_argument('--db_user', required=True) + arg_parser.add_argument('--db_password', required=True) + arg_parser.add_argument('--timeout', type=int, default=5) + + args = arg_parser.parse_args() + + start_time = time.time() + while (time.time() - start_time) < args.timeout: + try: + conn = psycopg2.connect(user=args.db_user, host=args.db_host, port=args.db_port, password=args.db_password, dbname='postgres') + error = '' + break + except psycopg2.OperationalError as e: + error = e + else: + conn.close() + time.sleep(1) + + if error: + print("Database connection failure: %s" % error, file=sys.stderr) + sys.exit(1) From 9c3a2dd128af4dde270f7248deb18a99b50d4072 Mon Sep 17 00:00:00 2001 From: Anang Aji Rahmawan Date: Sat, 26 Oct 2019 01:46:46 +0700 Subject: [PATCH 23/24] [FIX] Odoo 11.0-13.0: get database config value --- 11.0/entrypoint.sh | 11 ++++++----- 12.0/entrypoint.sh | 9 +++++---- 13.0/entrypoint.sh | 9 +++++---- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/11.0/entrypoint.sh b/11.0/entrypoint.sh index 5638e6d..8e7626d 100755 --- a/11.0/entrypoint.sh +++ b/11.0/entrypoint.sh @@ -12,11 +12,12 @@ set -e DB_ARGS=() function check_config() { param="$1" - value="$2" - if ! grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then - DB_ARGS+=("--${param}") - DB_ARGS+=("${value}") - fi; + value="$2" + if grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then + value=$(grep -E "^\s*\b${param}\b\s*=" "$ODOO_RC" |cut -d " " -f3|sed 's/["\n\r]//g') + fi; + DB_ARGS+=("--${param}") + DB_ARGS+=("${value}") } check_config "db_host" "$HOST" check_config "db_port" "$PORT" diff --git a/12.0/entrypoint.sh b/12.0/entrypoint.sh index 5638e6d..6dd42c4 100755 --- a/12.0/entrypoint.sh +++ b/12.0/entrypoint.sh @@ -13,10 +13,11 @@ DB_ARGS=() function check_config() { param="$1" value="$2" - if ! grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then - DB_ARGS+=("--${param}") - DB_ARGS+=("${value}") - fi; + if grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then + value=$(grep -E "^\s*\b${param}\b\s*=" "$ODOO_RC" |cut -d " " -f3|sed 's/["\n\r]//g') + fi; + DB_ARGS+=("--${param}") + DB_ARGS+=("${value}") } check_config "db_host" "$HOST" check_config "db_port" "$PORT" diff --git a/13.0/entrypoint.sh b/13.0/entrypoint.sh index 5638e6d..6dd42c4 100755 --- a/13.0/entrypoint.sh +++ b/13.0/entrypoint.sh @@ -13,10 +13,11 @@ DB_ARGS=() function check_config() { param="$1" value="$2" - if ! grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then - DB_ARGS+=("--${param}") - DB_ARGS+=("${value}") - fi; + if grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then + value=$(grep -E "^\s*\b${param}\b\s*=" "$ODOO_RC" |cut -d " " -f3|sed 's/["\n\r]//g') + fi; + DB_ARGS+=("--${param}") + DB_ARGS+=("${value}") } check_config "db_host" "$HOST" check_config "db_port" "$PORT" From 596a7cabc07dd3b1d18b6c2832cace7328e36969 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Wed, 6 Nov 2019 16:40:29 +0100 Subject: [PATCH 24/24] [REF] Odoo 11.0-13.0: update to release 20191106 --- 11.0/Dockerfile | 4 ++-- 12.0/Dockerfile | 4 ++-- 13.0/Dockerfile | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/11.0/Dockerfile b/11.0/Dockerfile index 6f84e46..3084bab 100644 --- a/11.0/Dockerfile +++ b/11.0/Dockerfile @@ -49,8 +49,8 @@ RUN set -x; \ # Install Odoo ENV ODOO_VERSION 11.0 -ARG ODOO_RELEASE=20191022 -ARG ODOO_SHA=eea3333a3d7402c4ff63a09d9da145a6a4a3bab2 +ARG ODOO_RELEASE=20191106 +ARG ODOO_SHA=d6da6c631fb9926c4440f2016d623c37fa38d4ea RUN set -x; \ curl -o odoo.deb -sSL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ && echo "${ODOO_SHA} odoo.deb" | sha1sum -c - \ diff --git a/12.0/Dockerfile b/12.0/Dockerfile index a93334a..3f8d315 100644 --- a/12.0/Dockerfile +++ b/12.0/Dockerfile @@ -63,8 +63,8 @@ RUN set -x;\ # Install Odoo ENV ODOO_VERSION 12.0 -ARG ODOO_RELEASE=20191022 -ARG ODOO_SHA=31cdde4a9f6cd9d2cbf6af45a5d301e0a0907148 +ARG ODOO_RELEASE=20191106 +ARG ODOO_SHA=8dd3d36bd371b1eb6fbeb9ff7b049c8aea84327c RUN set -x; \ curl -o odoo.deb -sSL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ && echo "${ODOO_SHA} odoo.deb" | sha1sum -c - \ diff --git a/13.0/Dockerfile b/13.0/Dockerfile index d20372e..9ff05c7 100644 --- a/13.0/Dockerfile +++ b/13.0/Dockerfile @@ -51,8 +51,8 @@ RUN set -x; \ # Install Odoo ENV ODOO_VERSION 13.0 -ARG ODOO_RELEASE=20191022 -ARG ODOO_SHA=09eb205ed1e4348dd4762263cafa9819e17dba7e +ARG ODOO_RELEASE=20191106 +ARG ODOO_SHA=b13bec4d20dfe36f1baa923719e37ea6bbe18a7d RUN set -x; \ curl -o odoo.deb -sSL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ && echo "${ODOO_SHA} odoo.deb" | sha1sum -c - \