Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/hadolint.yaml
Original file line number Diff line number Diff line change
@@ -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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1st question

Should we start pinning actions to commit SHA instead of tag, as recommended?

https://docs.github.com/en/actions/reference/security/secure-use#using-third-party-actions

2nd question

What is benefit of having it in a separate job, if it is already part of pre-commit hooks?

with:
recursive: true
15 changes: 15 additions & 0 deletions .hadolint.yaml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repos:
- repo: https://github.com/hadolint/hadolint
rev: v2.14.0
hooks:
- id: hadolint-docker
4 changes: 2 additions & 2 deletions 11.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions 12.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions 13.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions 14.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions 15.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions 16.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions 17.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions 18.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions 19.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion common/Dockerfile-batteries
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MAINTAINER Camptocamp
LABEL maintainer="Camptocamp"

WORKDIR "/odoo"
COPY ./extra_requirements.txt ./
Expand Down
2 changes: 1 addition & 1 deletion common/Dockerfile-onbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MAINTAINER Camptocamp
LABEL maintainer="Camptocamp"

COPY ./.coveragerc /odoo/

Expand Down
20 changes: 9 additions & 11 deletions example/odoo/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Loading