diff --git a/DEVELOP.md b/DEVELOP.md index b8ee1dd..593d514 100644 --- a/DEVELOP.md +++ b/DEVELOP.md @@ -121,6 +121,29 @@ Also this project is inspired by the following tools: * click-odoo-contrib (https://github.com/acsone/click-odoo-contrib) +# Dockerfile information + +### From version 5 to 7 + +There are no plans to make the tool work for these versions. + +### From version 8 to 10 (Python2) + +Try to create dockerfile, based on the odoo official ones fails. Any help welcome. + +### From version 11.0 to latest version. (Python3) + +The Dockerfile of the version 11 to the lastest version of Odoo are written this way : + +- Copy the content of https://github.com/odoo/odoo/blob/ODOO_VERSION/setup/package.dfsrc +- remove all the part after the big ``apt-get install`` +- install debian package ``git`` to have the possibility to pip install from git url. +- install custom debian packages +- install python odoo requirements +- install python ``setuptools-scm`` lib to have the possibility to pip install ``openupgradelib`` from git url. +- install python custom requirements +- makes link between external user and docker odoo user + ## Réferences - how to install gitlab runner locally: @@ -140,9 +163,15 @@ This part can help you if you want to change your autogenerated Dockerfiles. See (https://github.com/odoo/odoo/blob/ODOO_VERSION/setup/package.dfdebian) +### debian:wheezy (V7) (for Odoo: 8.0) +- Ubuntu release : 12.04 xxx, 12.10 xxx, 13.04 xxx, 14.10 xxx +- python2.7 +- First release : 04/05/2013 +- End LTS : May 2018 + ### debian:jessie (V8) (for Odoo: 9.0, 10.0) - Ubuntu release : 14.04 trusty, 14.10 utopic, 15.04 vivid, 15.10 wily -- python2.7 and ??? +- python2.7 - First release : 26/04/2015 - End LTS : June 2020 diff --git a/odoo_openupgrade_wizard/templates/odoo/11.0/Dockerfile b/odoo_openupgrade_wizard/templates/odoo/11.0/Dockerfile new file mode 100644 index 0000000..7536f93 --- /dev/null +++ b/odoo_openupgrade_wizard/templates/odoo/11.0/Dockerfile @@ -0,0 +1,56 @@ +# : Copy of https://github.com/odoo/odoo/blob/11.0/setup/package.dfsrc +FROM debian:stretch + +RUN apt-get update && \ + apt-get install -y locales && \ + rm -rf /var/lib/apt/lists/* + +# Reconfigure locales such that postgresql uses UTF-8 encoding +RUN dpkg-reconfigure locales && \ + locale-gen C.UTF-8 && \ + /usr/sbin/update-locale LANG=C.UTF-8 +ENV LC_ALL C.UTF-8 + +RUN apt-get update -qq && \ + apt-get upgrade -qq -y && \ + apt-get install \ + postgresql \ + postgresql-server-dev-all \ + postgresql-client \ + adduser \ + node-less \ + libxml2-dev \ + libxslt1-dev \ + libldap2-dev \ + libsasl2-dev \ + libssl-dev \ + libjpeg-dev \ + zlib1g-dev \ + python3-dev \ + python3-pip \ + python3-wheel \ + build-essential \ + python3 -y && \ + rm -rf /var/lib/apt/lists/* + +# Install Debian packages +COPY extra_debian_requirements.txt /extra_debian_requirements.txt +RUN apt-get update -qq \ + && apt-get install -y git \ + && xargs apt-get install -y --no-install-recommends Install Python librairies +COPY ./src/odoo/requirements.txt /odoo_python_requirements.txt +COPY extra_python_requirements.txt /extra_python_requirements.txt +RUN pip3 install --upgrade pip \ + && python3 -m pip install --no-cache-dir setuptools-scm \ + && python3 -m pip install --no-cache-dir -r /odoo_python_requirements.txt \ + && python3 -m pip install --no-cache-dir -r /extra_python_requirements.txt + +# Get local user id and set it to the odoo user +ARG LOCAL_USER_ID + +RUN useradd --uid $LOCAL_USER_ID odoo + +USER odoo diff --git a/odoo_openupgrade_wizard/templates/odoo/12.0/Dockerfile b/odoo_openupgrade_wizard/templates/odoo/12.0/Dockerfile index 09bbdcb..5b8b2af 100644 --- a/odoo_openupgrade_wizard/templates/odoo/12.0/Dockerfile +++ b/odoo_openupgrade_wizard/templates/odoo/12.0/Dockerfile @@ -1,72 +1,54 @@ -# : Copy of https://github.com/odoo/odoo/blob/12.0/setup/package.dfdebian - +# : Copy of https://github.com/odoo/odoo/blob/12.0/setup/package.dfsrc FROM debian:stretch -# 1. Official Odoo Dockerfile. -# Removing: postgresql, locales, rsync +RUN apt-get update && \ + apt-get install -y locales && \ + rm -rf /var/lib/apt/lists/* -ENV DEBIAN_FRONTEND noninteractive +# Reconfigure locales such that postgresql uses UTF-8 encoding +RUN dpkg-reconfigure locales && \ + locale-gen C.UTF-8 && \ + /usr/sbin/update-locale LANG=C.UTF-8 +ENV LC_ALL C.UTF-8 RUN apt-get update -qq && \ apt-get upgrade -qq -y && \ - apt-get install -yq \ - adduser \ - dh-python \ - packaging-dev \ + apt-get install \ + postgresql \ + postgresql-server-dev-all \ postgresql-client \ - python3 \ - python3-babel \ - python3-dateutil \ - python3-decorator \ - python3-docutils \ - python3-gevent \ - python3-html2text \ - python3-pil \ - python3-jinja2 \ - python3-libsass \ - python3-lxml \ - python3-mako \ - python3-mock \ - python3-ofxparse \ - python3-passlib \ - python3-psutil \ - python3-psycopg2 \ - python3-pydot \ - python3-pyparsing \ - python3-pypdf2 \ - python3-reportlab \ - python3-requests \ - python3-serial \ - python3-suds \ - python3-tz \ - python3-usb \ - python3-vatnumber \ - python3-vobject \ - python3-werkzeug \ - python3-xlsxwriter \ - && rm -rf /var/lib/apt/lists/* + adduser \ + libsass0 \ + libxml2-dev \ + libxslt1-dev \ + libldap2-dev \ + libsasl2-dev \ + libssl-dev \ + libjpeg-dev \ + zlib1g-dev \ + python3-dev \ + python3-pip \ + python3-wheel \ + build-essential \ + python3 -y && \ + rm -rf /var/lib/apt/lists/* -# 2. Add 2 python dependency files and 1 debian dependency file - -COPY ./src/odoo/requirements.txt /odoo_python_requirements.txt -COPY extra_python_requirements.txt /extra_python_requirements.txt +# Install Debian packages COPY extra_debian_requirements.txt /extra_debian_requirements.txt - -# 3. Install Debian packages -RUN apt-get update || true \ - && apt-get install -y\ - # To allow to run pip install - python3-pip\ - # For python-ldap - libldap2-dev ldap-utils libsasl2-dev\ +RUN apt-get update -qq \ + && apt-get install -y git \ && xargs apt-get install -y --no-install-recommends Install Python librairies -RUN python3 -m pip install --no-cache-dir -r /odoo_python_requirements.txt -RUN python3 -m pip install --no-cache-dir -r /extra_python_requirements.txt +# Install Python librairies +COPY ./src/odoo/requirements.txt /odoo_python_requirements.txt +COPY extra_python_requirements.txt /extra_python_requirements.txt +RUN pip3 install --upgrade pip \ + && python3 -m pip install --no-cache-dir setuptools-scm \ + && python3 -m pip install --no-cache-dir -r /odoo_python_requirements.txt \ + && python3 -m pip install --no-cache-dir -r /extra_python_requirements.txt -# 5. Get local user id and set it to the odoo user +# Get local user id and set it to the odoo user ARG LOCAL_USER_ID RUN useradd --uid $LOCAL_USER_ID odoo diff --git a/odoo_openupgrade_wizard/templates/odoo/13.0/Dockerfile b/odoo_openupgrade_wizard/templates/odoo/13.0/Dockerfile index 506ca1b..12f76e8 100644 --- a/odoo_openupgrade_wizard/templates/odoo/13.0/Dockerfile +++ b/odoo_openupgrade_wizard/templates/odoo/13.0/Dockerfile @@ -1,76 +1,54 @@ -# : Copy of https://github.com/odoo/odoo/blob/13.0/setup/package.dfdebian - +# : Copy of https://github.com/odoo/odoo/blob/13.0/setup/package.dfsrc FROM debian:buster -# 1. Official Odoo Dockerfile. -# Removing: postgresql, locales, rsync +RUN apt-get update && \ + apt-get install -y locales && \ + rm -rf /var/lib/apt/lists/* -ENV DEBIAN_FRONTEND noninteractive +# Reconfigure locales such that postgresql uses UTF-8 encoding +RUN dpkg-reconfigure locales && \ + locale-gen C.UTF-8 && \ + /usr/sbin/update-locale LANG=C.UTF-8 +ENV LC_ALL C.UTF-8 RUN apt-get update -qq && \ apt-get upgrade -qq -y && \ - apt-get install -qq -y\ - adduser \ - dh-python \ - packaging-dev \ + apt-get install \ + postgresql \ + postgresql-server-dev-all \ postgresql-client \ - python3 \ - python3-babel \ - python3-dateutil \ - python3-decorator \ - python3-docutils \ - python3-gevent \ - python3-pil \ - python3-jinja2 \ - python3-libsass \ - python3-lxml \ - python3-mako \ - python3-mock \ - python3-ofxparse \ - python3-passlib \ - python3-polib \ - python3-psutil \ - python3-psycopg2 \ - python3-pydot \ - python3-pyparsing \ - python3-pypdf2 \ - python3-qrcode \ - python3-renderpm \ - python3-reportlab \ - python3-requests \ - python3-serial \ - python3-tz \ - python3-usb \ - python3-vatnumber \ - python3-vobject \ - python3-werkzeug \ - python3-xlsxwriter \ - python3-zeep \ - && rm -rf /var/lib/apt/lists/* + adduser \ + libsass1 \ + libxml2-dev \ + libxslt1-dev \ + libldap2-dev \ + libsasl2-dev \ + libssl-dev \ + libjpeg-dev \ + zlib1g-dev \ + python3-dev \ + python3-pip \ + python3-wheel \ + build-essential \ + python3 -y && \ + rm -rf /var/lib/apt/lists/* -# 2. Add 2 python dependency files and 1 debian dependency file - -COPY ./src/odoo/requirements.txt /odoo_python_requirements.txt -COPY extra_python_requirements.txt /extra_python_requirements.txt +# Install Debian packages COPY extra_debian_requirements.txt /extra_debian_requirements.txt - -# 3. Install Debian packages -RUN apt-get update || true \ - && apt-get install -y\ - # To allow to run pip install - python3-pip\ - # For python-ldap - libldap2-dev ldap-utils libsasl2-dev\ - # For cffi - build-essential libssl-dev libffi-dev python-dev\ +RUN apt-get update -qq \ + && apt-get install -y git \ && xargs apt-get install -y --no-install-recommends Install Python librairies -RUN python3 -m pip install --no-cache-dir -r /odoo_python_requirements.txt -RUN python3 -m pip install --no-cache-dir -r /extra_python_requirements.txt +# Install Python librairies +COPY ./src/odoo/requirements.txt /odoo_python_requirements.txt +COPY extra_python_requirements.txt /extra_python_requirements.txt +RUN pip3 install --upgrade pip \ + && python3 -m pip install --no-cache-dir setuptools-scm \ + && python3 -m pip install --no-cache-dir -r /odoo_python_requirements.txt \ + && python3 -m pip install --no-cache-dir -r /extra_python_requirements.txt -# 5. Get local user id and set it to the odoo user +# Get local user id and set it to the odoo user ARG LOCAL_USER_ID RUN useradd --uid $LOCAL_USER_ID odoo diff --git a/odoo_openupgrade_wizard/templates/odoo/14.0/Dockerfile b/odoo_openupgrade_wizard/templates/odoo/14.0/Dockerfile index c5729d2..cdd91b3 100644 --- a/odoo_openupgrade_wizard/templates/odoo/14.0/Dockerfile +++ b/odoo_openupgrade_wizard/templates/odoo/14.0/Dockerfile @@ -1,75 +1,47 @@ -# : Copy of https://github.com/odoo/odoo/blob/14.0/setup/package.dfdebian - +# : Copy of https://github.com/odoo/odoo/blob/14.0/setup/package.dfsrc FROM debian:buster -# 1. Official Odoo Dockerfile. -# Removing: postgresql, locales, rsync +RUN apt-get update && \ + apt-get install -y locales && \ + rm -rf /var/lib/apt/lists/* -ENV DEBIAN_FRONTEND noninteractive +# Reconfigure locales such that postgresql uses UTF-8 encoding +RUN dpkg-reconfigure locales && \ + locale-gen C.UTF-8 && \ + /usr/sbin/update-locale LANG=C.UTF-8 +ENV LC_ALL C.UTF-8 RUN apt-get update -qq && \ apt-get upgrade -qq -y && \ - apt-get install -qq -y\ - adduser \ - dh-python \ - packaging-dev \ + apt-get install \ + postgresql \ + postgresql-server-dev-all \ postgresql-client \ - python3 \ - python3-babel \ - python3-dateutil \ - python3-decorator \ - python3-docutils \ - python3-gevent \ - python3-pil \ - python3-jinja2 \ - python3-libsass \ - python3-lxml \ - python3-mako \ - python3-ofxparse \ - python3-passlib \ - python3-polib \ - python3-psutil \ - python3-psycopg2 \ - python3-pydot \ - python3-pypdf2 \ - python3-qrcode \ - python3-renderpm \ - python3-reportlab \ - python3-requests \ - python3-serial \ - python3-setuptools \ - python3-stdnum \ - python3-tz \ - python3-usb \ - python3-vobject \ - python3-werkzeug \ - python3-xlsxwriter \ - python3-zeep \ - && rm -rf /var/lib/apt/lists/* + adduser \ + libldap2-dev \ + libsasl2-dev \ + python3-pip \ + python3-wheel \ + build-essential \ + python3 -y && \ + rm -rf /var/lib/apt/lists/* -# 2. Add 2 python dependency files and 1 debian dependency file - -COPY ./src/odoo/requirements.txt /odoo_python_requirements.txt -COPY extra_python_requirements.txt /extra_python_requirements.txt +# Install Debian packages COPY extra_debian_requirements.txt /extra_debian_requirements.txt - -# 3. Install Debian packages -RUN apt-get update || true \ - && apt-get install -y\ - # To allow to run pip install - python3-pip\ - # For python-ldap - libldap2-dev ldap-utils libsasl2-dev\ - # For cffi - build-essential libssl-dev libffi-dev python-dev\ +RUN apt-get update -qq \ + && apt-get install -y git \ && xargs apt-get install -y --no-install-recommends Install Python librairies -RUN python3 -m pip install --no-cache-dir -r /odoo_python_requirements.txt -RUN python3 -m pip install --no-cache-dir -r /extra_python_requirements.txt +# Install Python librairies +COPY ./src/odoo/requirements.txt /odoo_python_requirements.txt +COPY extra_python_requirements.txt /extra_python_requirements.txt +RUN pip3 install --upgrade pip \ + && python3 -m pip install --no-cache-dir setuptools-scm \ + && python3 -m pip install --no-cache-dir -r /odoo_python_requirements.txt \ + && python3 -m pip install --no-cache-dir -r /extra_python_requirements.txt -# 5. Get local user id and set it to the odoo user +# Get local user id and set it to the odoo user ARG LOCAL_USER_ID RUN useradd --uid $LOCAL_USER_ID odoo diff --git a/odoo_openupgrade_wizard/templates/odoo/15.0/Dockerfile b/odoo_openupgrade_wizard/templates/odoo/15.0/Dockerfile index 879024b..2c44e64 100644 --- a/odoo_openupgrade_wizard/templates/odoo/15.0/Dockerfile +++ b/odoo_openupgrade_wizard/templates/odoo/15.0/Dockerfile @@ -1,73 +1,47 @@ -# : Copy of https://github.com/odoo/odoo/blob/15.0/setup/package.dfdebian +# : Copy of https://github.com/odoo/odoo/blob/15.0/setup/package.dfsrc +FROM debian:buster -FROM debian:bullseye +RUN apt-get update && \ + apt-get install -y locales && \ + rm -rf /var/lib/apt/lists/* -# 1. Official Odoo Dockerfile. -# Removing: postgresql, locales, rsync - -ENV DEBIAN_FRONTEND noninteractive +# Reconfigure locales such that postgresql uses UTF-8 encoding +RUN dpkg-reconfigure locales && \ + locale-gen C.UTF-8 && \ + /usr/sbin/update-locale LANG=C.UTF-8 +ENV LC_ALL C.UTF-8 RUN apt-get update -qq && \ apt-get upgrade -qq -y && \ - apt-get install -qq -y\ - adduser \ - dh-python \ - packaging-dev \ + apt-get install \ + postgresql \ + postgresql-server-dev-all \ postgresql-client \ - python3 \ - python3-babel \ - python3-dateutil \ - python3-decorator \ - python3-docutils \ - python3-gevent \ - python3-pil \ - python3-jinja2 \ - python3-libsass \ - python3-lxml \ - python3-ofxparse \ - python3-passlib \ - python3-polib \ - python3-psutil \ - python3-psycopg2 \ - python3-pydot \ - python3-openssl \ - python3-pypdf2 \ - python3-qrcode \ - python3-renderpm \ - python3-reportlab \ - python3-requests \ - python3-serial \ - python3-setuptools \ - python3-stdnum \ - python3-tz \ - python3-usb \ - python3-vobject \ - python3-werkzeug \ - python3-xlsxwriter \ - python3-zeep \ - && rm -rf /var/lib/apt/lists/* + adduser \ + libldap2-dev \ + libsasl2-dev \ + python3-pip \ + python3-wheel \ + build-essential \ + python3 -y && \ + rm -rf /var/lib/apt/lists/* -# 2. Add 2 python dependency files and 1 debian dependency file - -COPY ./src/odoo/requirements.txt /odoo_python_requirements.txt -COPY extra_python_requirements.txt /extra_python_requirements.txt +# Install Debian packages COPY extra_debian_requirements.txt /extra_debian_requirements.txt - -# 3. Install Debian packages -RUN apt-get update || true \ - && apt-get install -y\ - # To allow to run pip install - python3-pip\ - # For python-ldap - libldap2-dev ldap-utils libsasl2-dev\ +RUN apt-get update -qq \ + && apt-get install -y git \ && xargs apt-get install -y --no-install-recommends Install Python librairies -RUN python3 -m pip install --no-cache-dir -r /odoo_python_requirements.txt -RUN python3 -m pip install --no-cache-dir -r /extra_python_requirements.txt +# Install Python librairies +COPY ./src/odoo/requirements.txt /odoo_python_requirements.txt +COPY extra_python_requirements.txt /extra_python_requirements.txt +RUN pip3 install --upgrade pip \ + && python3 -m pip install --no-cache-dir setuptools-scm \ + && python3 -m pip install --no-cache-dir -r /odoo_python_requirements.txt \ + && python3 -m pip install --no-cache-dir -r /extra_python_requirements.txt -# 5. Get local user id and set it to the odoo user +# Get local user id and set it to the odoo user ARG LOCAL_USER_ID RUN useradd --uid $LOCAL_USER_ID odoo diff --git a/odoo_openupgrade_wizard/templates/odoo/16.0/Dockerfile b/odoo_openupgrade_wizard/templates/odoo/16.0/Dockerfile index 723b4a9..b4a4b53 100644 --- a/odoo_openupgrade_wizard/templates/odoo/16.0/Dockerfile +++ b/odoo_openupgrade_wizard/templates/odoo/16.0/Dockerfile @@ -1,73 +1,47 @@ -# : Copy of https://github.com/odoo/odoo/blob/16.0/setup/package.dfdebian +# : Copy of https://github.com/odoo/odoo/blob/16.0/setup/package.dfsrc +FROM debian:buster -FROM debian:bullseye +RUN apt-get update && \ + apt-get install -y locales && \ + rm -rf /var/lib/apt/lists/* -# 1. Official Odoo Dockerfile. -# Removing: postgresql, locales, rsync - -ENV DEBIAN_FRONTEND noninteractive +# Reconfigure locales such that postgresql uses UTF-8 encoding +RUN dpkg-reconfigure locales && \ + locale-gen C.UTF-8 && \ + /usr/sbin/update-locale LANG=C.UTF-8 +ENV LC_ALL C.UTF-8 RUN apt-get update -qq && \ apt-get upgrade -qq -y && \ - apt-get install -qq -y\ - adduser \ - dh-python \ - packaging-dev \ + apt-get install \ + postgresql \ + postgresql-server-dev-all \ postgresql-client \ - python3 \ - python3-babel \ - python3-dateutil \ - python3-decorator \ - python3-docutils \ - python3-gevent \ - python3-pil \ - python3-jinja2 \ - python3-libsass \ - python3-lxml \ - python3-ofxparse \ - python3-passlib \ - python3-polib \ - python3-psutil \ - python3-psycopg2 \ - python3-pydot \ - python3-openssl \ - python3-pypdf2 \ - python3-qrcode \ - python3-renderpm \ - python3-reportlab \ - python3-requests \ - python3-serial \ - python3-setuptools \ - python3-stdnum \ - python3-tz \ - python3-usb \ - python3-vobject \ - python3-werkzeug \ - python3-xlsxwriter \ - python3-zeep \ - && rm -rf /var/lib/apt/lists/* + adduser \ + libldap2-dev \ + libsasl2-dev \ + python3-pip \ + python3-wheel \ + build-essential \ + python3 -y && \ + rm -rf /var/lib/apt/lists/* -# 2. Add 2 python dependency files and 1 debian dependency file - -COPY ./src/odoo/requirements.txt /odoo_python_requirements.txt -COPY extra_python_requirements.txt /extra_python_requirements.txt +# Install Debian packages COPY extra_debian_requirements.txt /extra_debian_requirements.txt - -# 3. Install Debian packages -RUN apt-get update || true \ - && apt-get install -y\ - # To allow to run pip install - python3-pip\ - # For python-ldap - libldap2-dev ldap-utils libsasl2-dev\ +RUN apt-get update -qq \ + && apt-get install -y git \ && xargs apt-get install -y --no-install-recommends Install Python librairies -RUN python3 -m pip install --no-cache-dir -r /odoo_python_requirements.txt -RUN python3 -m pip install --no-cache-dir -r /extra_python_requirements.txt +# Install Python librairies +COPY ./src/odoo/requirements.txt /odoo_python_requirements.txt +COPY extra_python_requirements.txt /extra_python_requirements.txt +RUN pip3 install --upgrade pip \ + && python3 -m pip install --no-cache-dir setuptools-scm \ + && python3 -m pip install --no-cache-dir -r /odoo_python_requirements.txt \ + && python3 -m pip install --no-cache-dir -r /extra_python_requirements.txt -# 5. Get local user id and set it to the odoo user +# Get local user id and set it to the odoo user ARG LOCAL_USER_ID RUN useradd --uid $LOCAL_USER_ID odoo