diff --git a/.github/workflows/hadolint.yaml b/.github/workflows/hadolint.yaml new file mode 100644 index 00000000..49babab0 --- /dev/null +++ b/.github/workflows/hadolint.yaml @@ -0,0 +1,21 @@ +name: hadolint + +on: + push: + branches: + - "release-4.5.X" + - "dev-4.5.X" + pull_request: + branches: + - "release-4.5.X" + +jobs: + + hadolint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: Lint Dockerfiles + uses: hadolint/hadolint-action@v3.3.0 + with: + recursive: true diff --git a/.hadolint.yaml b/.hadolint.yaml new file mode 100644 index 00000000..79a4b7c3 --- /dev/null +++ b/.hadolint.yaml @@ -0,0 +1,15 @@ +# Hadolint configuration +# https://github.com/hadolint/hadolint#configure + +ignored: + # Pin versions in apt-get install: package installation is delegated to + # install/*.sh scripts, pinning isn't practical for base images. + - DL3008 + # Pin versions in pip install: handled via requirements.txt files. + - DL3013 + # Avoid cache directory with pip: cache is cleaned by + # install/purge_dev_package_and_cache.sh. + - DL3042 + # Last USER should not be root: the entrypoint uses gosu to step down + # from root, so running as root at build time is intentional. + - DL3002 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..af820b3b --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,5 @@ +repos: + - repo: https://github.com/hadolint/hadolint + rev: v2.14.0 + hooks: + - id: hadolint-docker diff --git a/11.0/Dockerfile b/11.0/Dockerfile index e8a3f1d6..bb0ff480 100644 --- a/11.0/Dockerfile +++ b/11.0/Dockerfile @@ -1,10 +1,10 @@ FROM python:3.7-slim-bookworm -MAINTAINER Camptocamp +LABEL maintainer="Camptocamp" # create the working directory and a place to set the logs (if wanted) RUN mkdir -p /odoo /var/log/odoo -COPY ./base_requirements.txt ./platform_requirements.txt /odoo +COPY ./base_requirements.txt ./platform_requirements.txt /odoo/ COPY ./install /install # Moved because there was a bug while installing `odoo-autodiscover`. There is diff --git a/12.0/Dockerfile b/12.0/Dockerfile index b0c17589..600d84f3 100644 --- a/12.0/Dockerfile +++ b/12.0/Dockerfile @@ -1,10 +1,10 @@ FROM python:3.9-slim-trixie -MAINTAINER Camptocamp +LABEL maintainer="Camptocamp" # create the working directory and a place to set the logs (if wanted) RUN mkdir -p /odoo /var/log/odoo -COPY ./base_requirements.txt ./platform_requirements.txt /odoo +COPY ./base_requirements.txt ./platform_requirements.txt /odoo/ COPY ./install /install # Moved because there was a bug while installing `odoo-autodiscover`. There is diff --git a/13.0/Dockerfile b/13.0/Dockerfile index 32c03bf0..c6237189 100644 --- a/13.0/Dockerfile +++ b/13.0/Dockerfile @@ -1,10 +1,10 @@ FROM python:3.9-slim-trixie -MAINTAINER Camptocamp +LABEL maintainer="Camptocamp" # create the working directory and a place to set the logs (if wanted) RUN mkdir -p /odoo /var/log/odoo -COPY ./base_requirements.txt ./platform_requirements.txt /odoo +COPY ./base_requirements.txt ./platform_requirements.txt /odoo/ COPY ./install /install # Moved because there was a bug while installing `odoo-autodiscover`. There is diff --git a/14.0/Dockerfile b/14.0/Dockerfile index 2d735eb0..ba514020 100644 --- a/14.0/Dockerfile +++ b/14.0/Dockerfile @@ -1,10 +1,10 @@ FROM python:3.9-slim-trixie -MAINTAINER Camptocamp +LABEL maintainer="Camptocamp" # create the working directory and a place to set the logs (if wanted) RUN mkdir -p /odoo /var/log/odoo -COPY ./base_requirements.txt ./platform_requirements.txt /odoo +COPY ./base_requirements.txt ./platform_requirements.txt /odoo/ COPY ./install /install # Moved because there was a bug while installing `odoo-autodiscover`. There is diff --git a/15.0/Dockerfile b/15.0/Dockerfile index c8fecbcc..2e49e232 100644 --- a/15.0/Dockerfile +++ b/15.0/Dockerfile @@ -1,10 +1,10 @@ FROM python:3.12-slim-trixie -MAINTAINER Camptocamp +LABEL maintainer="Camptocamp" # create the working directory and a place to set the logs (if wanted) RUN mkdir -p /odoo /var/log/odoo -COPY ./base_requirements.txt ./platform_requirements.txt /odoo +COPY ./base_requirements.txt ./platform_requirements.txt /odoo/ COPY ./install /install # Moved because there was a bug while installing `odoo-autodiscover`. There is diff --git a/16.0/Dockerfile b/16.0/Dockerfile index 6b9781cc..bb425693 100644 --- a/16.0/Dockerfile +++ b/16.0/Dockerfile @@ -1,10 +1,10 @@ FROM python:3.12-slim-trixie -MAINTAINER Camptocamp +LABEL maintainer="Camptocamp" # create the working directory and a place to set the logs (if wanted) RUN mkdir -p /odoo /var/log/odoo -COPY ./base_requirements.txt ./platform_requirements.txt /odoo +COPY ./base_requirements.txt ./platform_requirements.txt /odoo/ COPY ./install /install # Moved because there was a bug while installing `odoo-autodiscover`. There is diff --git a/17.0/Dockerfile b/17.0/Dockerfile index f3e7b9d2..c68ac84a 100644 --- a/17.0/Dockerfile +++ b/17.0/Dockerfile @@ -1,10 +1,10 @@ FROM python:3.12-slim-trixie -MAINTAINER Camptocamp +LABEL maintainer="Camptocamp" # create the working directory and a place to set the logs (if wanted) RUN mkdir -p /odoo /var/log/odoo -COPY ./base_requirements.txt ./platform_requirements.txt /odoo +COPY ./base_requirements.txt ./platform_requirements.txt /odoo/ COPY ./install /install # Moved because there was a bug while installing `odoo-autodiscover`. There is diff --git a/18.0/Dockerfile b/18.0/Dockerfile index 785013f4..1c4a06e2 100644 --- a/18.0/Dockerfile +++ b/18.0/Dockerfile @@ -1,10 +1,10 @@ FROM python:3.12-slim-trixie -MAINTAINER Camptocamp +LABEL maintainer="Camptocamp" # create the working directory and a place to set the logs (if wanted) RUN mkdir -p /odoo /var/log/odoo -COPY ./base_requirements.txt ./platform_requirements.txt /odoo +COPY ./base_requirements.txt ./platform_requirements.txt /odoo/ COPY ./install /install # Moved because there was a bug while installing `odoo-autodiscover`. There is diff --git a/19.0/Dockerfile b/19.0/Dockerfile index 567d269a..afb45532 100644 --- a/19.0/Dockerfile +++ b/19.0/Dockerfile @@ -1,10 +1,10 @@ FROM python:3.12-slim-trixie -MAINTAINER Camptocamp +LABEL maintainer="Camptocamp" # create the working directory and a place to set the logs (if wanted) RUN mkdir -p /odoo /var/log/odoo -COPY ./base_requirements.txt ./platform_requirements.txt /odoo +COPY ./base_requirements.txt ./platform_requirements.txt /odoo/ COPY ./install /install # Moved because there was a bug while installing `odoo-autodiscover`. There is diff --git a/common/Dockerfile-batteries b/common/Dockerfile-batteries index 600f7dbb..f818f034 100644 --- a/common/Dockerfile-batteries +++ b/common/Dockerfile-batteries @@ -1,4 +1,4 @@ -MAINTAINER Camptocamp +LABEL maintainer="Camptocamp" WORKDIR "/odoo" COPY ./extra_requirements.txt ./ diff --git a/common/Dockerfile-onbuild b/common/Dockerfile-onbuild index 5e6d722c..36a2d72e 100644 --- a/common/Dockerfile-onbuild +++ b/common/Dockerfile-onbuild @@ -1,4 +1,4 @@ -MAINTAINER Camptocamp +LABEL maintainer="Camptocamp" COPY ./.coveragerc /odoo/ diff --git a/example/odoo/Dockerfile b/example/odoo/Dockerfile index 143c21b0..39b978b2 100644 --- a/example/odoo/Dockerfile +++ b/example/odoo/Dockerfile @@ -1,5 +1,5 @@ FROM ci-latest:0.1 -MAINTAINER Camptocamp +LABEL maintainer="Camptocamp" # For installing odoo you have two possibility # 1. either adding the whole root directory @@ -16,20 +16,18 @@ COPY ./setup.py /odoo/ COPY ./VERSION /odoo/ COPY ./migration.yml /odoo/ -USER root -RUN pip install -e /odoo - -RUN pip install -e /odoo/src +COPY ./requirements.txt /odoo/ -# Project's specifics packages +USER root RUN set -x; \ - apt-get update \ + pip install -e /odoo \ + && pip install -e /odoo/src \ + # Project's specifics packages + && apt-get update \ && apt-get install -y --no-install-recommends \ python3-shapely \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -COPY ./requirements.txt /odoo/ -RUN cd /odoo && pip install -r requirements.txt + && rm -rf /var/lib/apt/lists/* \ + && pip install -r /odoo/requirements.txt ENV ADDONS_PATH=/odoo/local-src,/odoo/src/addons