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