docker-odoo/12.0/Dockerfile
Christophe Monniez 87f0174dca [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.
2019-01-30 15:43:24 +01:00

89 lines
3.1 KiB
Docker

FROM debian:stretch
LABEL maintainer="Odoo S.A. <info@odoo.com>"
# 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 \
libssl1.0-dev \
node-less \
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/ 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 - \
&& gpgconf --kill all \
&& rm -rf "$GNUPGHOME" \
&& apt-get update \
&& apt-get install -y postgresql-client
# 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 - \
&& gpgconf --kill all \
&& rm -rf "$GNUPGHOME" \
&& apt-get update \
&& apt-get install -y nodejs \
&& npm install -g rtlcss
# Install Odoo
ENV ODOO_VERSION 12.0
ARG ODOO_RELEASE=20190128
ARG ODOO_SHA=9e34aaed2eb1e7697aaf36767247dbf335e9fe7a
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"]