From 3e06fdf97d0105362fdfff42fc8a271b4f4cc9db Mon Sep 17 00:00:00 2001 From: Andris Date: Sun, 2 Feb 2020 16:03:29 +0100 Subject: [PATCH] [FIX] Odoo 11.0-13.0: set the default shell to bash It appears that dash can be unpredictable. Also, uses the `pipefail` as stated in the Dockerfile best practice [1]. [1] https://github.com/docker/docker.github.io/blob/master/develop/develop-images/dockerfile_best-practices.md#using-pipes --- 11.0/Dockerfile | 11 +++++------ 12.0/Dockerfile | 14 ++++++-------- 13.0/Dockerfile | 14 ++++++-------- 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/11.0/Dockerfile b/11.0/Dockerfile index 482b08a..505bc9a 100644 --- a/11.0/Dockerfile +++ b/11.0/Dockerfile @@ -1,6 +1,8 @@ FROM debian:stretch-slim MAINTAINER Odoo S.A. +SHELL ["/bin/bash", "-xo", "pipefail", "-c"] + # Generate locale C.UTF-8 for postgres and general locale data ENV LANG C.UTF-8 @@ -8,8 +10,7 @@ ENV LANG C.UTF-8 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 \ +RUN apt-get update \ && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ @@ -37,8 +38,7 @@ RUN set -x; \ && 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 \ +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' > /etc/apt/sources.list.d/pgdg.list \ && export GNUPGHOME="$(mktemp -d)" \ && repokey='B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8' \ && gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "${repokey}" \ @@ -53,8 +53,7 @@ RUN set -x; \ ENV ODOO_VERSION 11.0 ARG ODOO_RELEASE=20200417 ARG ODOO_SHA=e21c34a263785eea09babd7a0d876ba05c841935 -RUN set -x; \ - curl -o odoo.deb -sSL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ +RUN 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 - \ && apt-get update \ && apt-get -y install --no-install-recommends ./odoo.deb\ diff --git a/12.0/Dockerfile b/12.0/Dockerfile index a8b680d..20d4321 100644 --- a/12.0/Dockerfile +++ b/12.0/Dockerfile @@ -1,6 +1,8 @@ FROM debian:stretch-slim MAINTAINER Odoo S.A. +SHELL ["/bin/bash", "-xo", "pipefail", "-c"] + # Generate locale C.UTF-8 for postgres and general locale data ENV LANG C.UTF-8 @@ -8,8 +10,7 @@ ENV LANG C.UTF-8 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 \ +RUN apt-get update \ && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ @@ -37,8 +38,7 @@ RUN set -x; \ && 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 \ +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' > /etc/apt/sources.list.d/pgdg.list \ && export GNUPGHOME="$(mktemp -d)" \ && repokey='B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8' \ && gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "${repokey}" \ @@ -50,8 +50,7 @@ RUN set -x; \ && 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 \ +RUN echo "deb http://deb.nodesource.com/node_8.x stretch main" > /etc/apt/sources.list.d/nodesource.list \ && export GNUPGHOME="$(mktemp -d)" \ && repokey='9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280' \ && gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "${repokey}" \ @@ -67,8 +66,7 @@ RUN set -x;\ ENV ODOO_VERSION 12.0 ARG ODOO_RELEASE=20200417 ARG ODOO_SHA=ca4a7485b0b75850ffe1458a8f3266839400a501 -RUN set -x; \ - curl -o odoo.deb -sSL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ +RUN 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 - \ && apt-get update \ && apt-get -y install --no-install-recommends ./odoo.deb \ diff --git a/13.0/Dockerfile b/13.0/Dockerfile index 11789fb..f11a88c 100644 --- a/13.0/Dockerfile +++ b/13.0/Dockerfile @@ -1,12 +1,13 @@ FROM debian:buster-slim MAINTAINER Odoo S.A. +SHELL ["/bin/bash", "-xo", "pipefail", "-c"] + # 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 \ +RUN apt-get update \ && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ @@ -35,8 +36,7 @@ RUN set -x; \ && 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 \ +RUN 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}" \ @@ -48,15 +48,13 @@ RUN set -x; \ && rm -rf /var/lib/apt/lists/* # Install rtlcss (on Debian buster) -RUN set -x; \ - npm install -g rtlcss +RUN npm install -g rtlcss # Install Odoo ENV ODOO_VERSION 13.0 ARG ODOO_RELEASE=20200417 ARG ODOO_SHA=db29fbcebf63f9f656e9445f462190ac775ee533 -RUN set -x; \ - curl -o odoo.deb -sSL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ +RUN 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 - \ && apt-get update \ && apt-get -y install --no-install-recommends ./odoo.deb \