From 14db1d3acf2e510afc499d78e255c53b83a70d63 Mon Sep 17 00:00:00 2001 From: Colin Newell Date: Thu, 30 Jul 2015 12:27:11 +0100 Subject: [PATCH 1/6] Add locales to the image and set it to en_GB out of the box. Override the LC_ALL, LANGUAGE, LANG, locale-gen environment variables if you want a different locale. --- 8.0/Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 9a69b94..2e25c5c 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -11,6 +11,8 @@ RUN set -x; \ npm \ python-support \ python-pyinotify \ + locales-all \ + locales \ && npm install -g less less-plugin-clean-css \ && ln -s /usr/bin/nodejs /usr/bin/node \ && curl -o wkhtmltox.deb -SL http://nightly.odoo.com/extra/wkhtmltox-0.12.1.2_linux-jessie-amd64.deb \ @@ -35,6 +37,11 @@ COPY ./entrypoint.sh / COPY ./openerp-server.conf /etc/odoo/ RUN chown odoo /etc/odoo/openerp-server.conf +RUN locale-gen en_GB.UTF-8 +ENV LANG en_GB.UTF-8 +ENV LANGUAGE en_GB:en +ENV LC_ALL en_GB.UTF-8 + # Mount /var/lib/odoo to allow restoring filestore and /mnt/extra-addons for users addons VOLUME ["/var/lib/odoo", "/mnt/extra-addons"] From 44e600fcfd0365efc1740f710dc9e2aed62fc9fa Mon Sep 17 00:00:00 2001 From: Colin Newell Date: Thu, 30 Jul 2015 12:29:01 +0100 Subject: [PATCH 2/6] Install the barcode fonts and dejavu fonts required for reports. --- 8.0/Dockerfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 2e25c5c..239a737 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -11,6 +11,10 @@ RUN set -x; \ npm \ python-support \ python-pyinotify \ + fonts-dejavu \ + fonts-dejavu-core \ + fonts-dejavu-extra \ + unzip \ locales-all \ locales \ && npm install -g less less-plugin-clean-css \ @@ -32,6 +36,11 @@ RUN set -x; \ && apt-get -y install -f --no-install-recommends \ && rm -rf /var/lib/apt/lists/* odoo.deb +# Install barcode font +RUN curl http://www.reportlab.com/ftp/pfbfer.zip --output /tmp/pfbfer.zip \ + && mkdir -p /usr/lib/python2.7/dist-packages/reportlab/fonts \ + && unzip /tmp/pfbfer.zip -d /usr/lib/python2.7/dist-packages/reportlab/fonts/ + # Copy entrypoint script and Odoo configuration file COPY ./entrypoint.sh / COPY ./openerp-server.conf /etc/odoo/ From 6547b0d18832364752d80a27bf8d6eb050e63d20 Mon Sep 17 00:00:00 2001 From: Colin Newell Date: Thu, 30 Jul 2015 12:31:21 +0100 Subject: [PATCH 3/6] Add support for gosu to allow for root access. Additionally deal with case of user specifiying openerp-server as part of the command line to run. --- 8.0/Dockerfile | 12 +++++++++--- 8.0/entrypoint.sh | 21 ++++++++++++--------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 239a737..ed4ee30 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -1,6 +1,15 @@ FROM debian:jessie MAINTAINER Odoo S.A. +# grab gosu for easy step-down from root +RUN gpg --keyserver pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 +RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ +&& curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)" \ +&& curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc" \ +&& gpg --verify /usr/local/bin/gosu.asc \ +&& rm /usr/local/bin/gosu.asc \ +&& chmod +x /usr/local/bin/gosu + # Install some deps, lessc and less-plugin-clean-css, and wkhtmltopdf RUN set -x; \ apt-get update \ @@ -60,8 +69,5 @@ EXPOSE 8069 8071 # Set the default config file ENV OPENERP_SERVER /etc/odoo/openerp-server.conf -# Set default user when running the container -USER odoo - ENTRYPOINT ["/entrypoint.sh"] CMD ["openerp-server"] diff --git a/8.0/entrypoint.sh b/8.0/entrypoint.sh index 8ec01b4..22fc0fb 100755 --- a/8.0/entrypoint.sh +++ b/8.0/entrypoint.sh @@ -10,15 +10,18 @@ set -e export PGHOST PGPORT PGUSER PGPASSWORD case "$1" in - --) - shift - exec openerp-server "$@" - ;; - -*) - exec openerp-server "$@" - ;; - *) - exec "$@" + --) + shift + exec gosu odoo openerp-server "$@" + ;; + -*) + exec gosu odoo openerp-server "$@" + ;; + openerp-server) + exec gosu odoo "$@" + ;; + *) + exec "$@" esac exit 1 From cf4c0899588e026ff05e816bec7c1723d8807f07 Mon Sep 17 00:00:00 2001 From: Colin Newell Date: Wed, 25 Nov 2015 23:50:26 +0000 Subject: [PATCH 4/6] Remove manual less installation to go with the official installation mechanism --- 8.0/Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index c9ba3b7..2f7036b 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -27,8 +27,6 @@ RUN set -x; \ python-renderpm \ python-support \ locales \ - && npm install -g less less-plugin-clean-css \ - && ln -s /usr/bin/nodejs /usr/bin/node \ && 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 - \ && dpkg --force-depends -i wkhtmltox.deb \ From dceb4e4c4ebc6f79edeab008e1a8207b4399eb08 Mon Sep 17 00:00:00 2001 From: Colin Newell Date: Thu, 10 Mar 2016 10:07:05 +0000 Subject: [PATCH 5/6] Parametize language --- 8.0/Dockerfile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 2f7036b..b944a30 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -54,10 +54,13 @@ COPY ./entrypoint.sh / COPY ./openerp-server.conf /etc/odoo/ RUN chown odoo /etc/odoo/openerp-server.conf -RUN locale-gen en_GB.UTF-8 -ENV LANG en_GB.UTF-8 -ENV LANGUAGE en_GB:en -ENV LC_ALL en_GB.UTF-8 +ARG language=en_GB:en +ARG lang=en_GB.UTF-8 + +RUN locale-gen ${lang} +ENV LANG ${lang} +ENV LANGUAGE ${language} +ENV LC_ALL ${lang} # Mount /var/lib/odoo to allow restoring filestore and /mnt/extra-addons for users addons RUN mkdir -p /mnt/extra-addons \ From d069d03dcff679146428d7ca6164e7df15c7ffbf Mon Sep 17 00:00:00 2001 From: Colin Newell Date: Thu, 10 Mar 2016 10:21:18 +0000 Subject: [PATCH 6/6] Revert "Parametize language" This reverts commit dceb4e4c4ebc6f79edeab008e1a8207b4399eb08. Removed temporarily because quay.io doesn't appear to support ARG. --- 8.0/Dockerfile | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 14c054d..335b1a1 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -55,13 +55,10 @@ COPY ./entrypoint.sh / COPY ./openerp-server.conf /etc/odoo/ RUN chown odoo /etc/odoo/openerp-server.conf -ARG language=en_GB:en -ARG lang=en_GB.UTF-8 - -RUN locale-gen ${lang} -ENV LANG ${lang} -ENV LANGUAGE ${language} -ENV LC_ALL ${lang} +RUN locale-gen en_GB.UTF-8 +ENV LANG en_GB.UTF-8 +ENV LANGUAGE en_GB:en +ENV LC_ALL en_GB.UTF-8 # Mount /var/lib/odoo to allow restoring filestore and /mnt/extra-addons for users addons RUN mkdir -p /mnt/extra-addons \