-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
images for Odoo 12, 13, 14, 15 and 16
- Loading branch information
Showing
7 changed files
with
123 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM python:3.10.12-alpine3.18 | ||
|
||
RUN apk fix && \ | ||
apk --no-cache --update add git git-lfs gpg less openssh patch bash && \ | ||
git lfs install | ||
|
||
# we cannot use a more recent version for now | ||
# see https://github.com/yaml/pyyaml/issues/724 | ||
# note that we install ak and git-aggregator to be able to do ak-build | ||
# later in a builder image based on this image and ensure odoo/src | ||
# is converged to the proper revision with the proper merges | ||
RUN pip install PyYaml==5.3.1 | ||
RUN pip install git+https://github.com/akretion/ak | ||
|
||
COPY repos.yml /root/.config/git-autoshare/repos.yml | ||
RUN pip install git-autoshare git-aggregator | ||
COPY bin/* /usr/local/bin/ | ||
COPY install/* /install/ | ||
|
||
# pre-fetch the git-autoshare cache with the bare minimum: | ||
ADD https://api.github.com/repos/odoo/odoo/git/refs/heads/12.0 version.json | ||
RUN mkdir -p /root/.cache/git-autoshare/github.com/odoo && \ | ||
cd /root/.cache/git-autoshare/github.com/odoo && \ | ||
/usr/bin/git init --bare && \ | ||
/usr/bin/git fetch https://github.com/OCA/OCB.git refs/heads/12.0:refs/git-autoshare/oca/heads/12.0 --shallow-since=2018-10-01 && \ | ||
/usr/bin/git fetch https://github.com/odoo/odoo.git refs/heads/12.0:refs/git-autoshare/odoo/heads/12.0 --shallow-since=2018-10-01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM python:3.10.12-alpine3.18 | ||
|
||
RUN apk fix && \ | ||
apk --no-cache --update add git git-lfs gpg less openssh patch bash && \ | ||
git lfs install | ||
|
||
# we cannot use a more recent version for now | ||
# see https://github.com/yaml/pyyaml/issues/724 | ||
# note that we install ak and git-aggregator to be able to do ak-build | ||
# later in a builder image based on this image and ensure odoo/src | ||
# is converged to the proper revision with the proper merges | ||
RUN pip install PyYaml==5.3.1 | ||
RUN pip install git+https://github.com/akretion/ak | ||
|
||
COPY repos.yml /root/.config/git-autoshare/repos.yml | ||
RUN pip install git-autoshare git-aggregator | ||
COPY bin/* /usr/local/bin/ | ||
COPY install/* /install/ | ||
|
||
# pre-fetch the git-autoshare cache with the bare minimum: | ||
ADD https://api.github.com/repos/odoo/odoo/git/refs/heads/13.0 version.json | ||
RUN mkdir -p /root/.cache/git-autoshare/github.com/odoo && \ | ||
cd /root/.cache/git-autoshare/github.com/odoo && \ | ||
/usr/bin/git init --bare && \ | ||
/usr/bin/git fetch https://github.com/OCA/OCB.git refs/heads/13.0:refs/git-autoshare/oca/heads/13.0 --shallow-since=2019-10-01 && \ | ||
/usr/bin/git fetch https://github.com/odoo/odoo.git refs/heads/13.0:refs/git-autoshare/odoo/heads/13.0 --shallow-since=2019-10-01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM python:3.10.12-alpine3.18 | ||
|
||
RUN apk fix && \ | ||
apk --no-cache --update add git git-lfs gpg less openssh patch bash && \ | ||
git lfs install | ||
|
||
# we cannot use a more recent version for now | ||
# see https://github.com/yaml/pyyaml/issues/724 | ||
# note that we install ak and git-aggregator to be able to do ak-build | ||
# later in a builder image based on this image and ensure odoo/src | ||
# is converged to the proper revision with the proper merges | ||
RUN pip install PyYaml==5.3.1 | ||
RUN pip install git+https://github.com/akretion/ak | ||
|
||
COPY repos.yml /root/.config/git-autoshare/repos.yml | ||
RUN pip install git-autoshare git-aggregator | ||
COPY bin/* /usr/local/bin/ | ||
COPY install/* /install/ | ||
|
||
# pre-fetch the git-autoshare cache with the bare minimum: | ||
ADD https://api.github.com/repos/odoo/odoo/git/refs/heads/15.0 version.json | ||
RUN mkdir -p /root/.cache/git-autoshare/github.com/odoo && \ | ||
cd /root/.cache/git-autoshare/github.com/odoo && \ | ||
/usr/bin/git init --bare && \ | ||
/usr/bin/git fetch https://github.com/OCA/OCB.git refs/heads/15.0:refs/git-autoshare/oca/heads/15.0 --shallow-since=2021-10-01 && \ | ||
/usr/bin/git fetch https://github.com/odoo/odoo.git refs/heads/15.0:refs/git-autoshare/odoo/heads/15.0 --shallow-since=2021-10-01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM python:3.10.12-alpine3.18 | ||
|
||
RUN apk fix && \ | ||
apk --no-cache --update add git git-lfs gpg less openssh patch bash && \ | ||
git lfs install | ||
|
||
# we cannot use a more recent version for now | ||
# see https://github.com/yaml/pyyaml/issues/724 | ||
# note that we install ak and git-aggregator to be able to do ak-build | ||
# later in a builder image based on this image and ensure odoo/src | ||
# is converged to the proper revision with the proper merges | ||
RUN pip install PyYaml==5.3.1 | ||
RUN pip install git+https://github.com/akretion/ak | ||
|
||
COPY repos.yml /root/.config/git-autoshare/repos.yml | ||
RUN pip install git-autoshare git-aggregator | ||
COPY bin/* /usr/local/bin/ | ||
COPY install/* /install/ | ||
|
||
# pre-fetch the git-autoshare cache with the bare minimum: | ||
ADD https://api.github.com/repos/odoo/odoo/git/refs/heads/16.0 version.json | ||
RUN mkdir -p /root/.cache/git-autoshare/github.com/odoo && \ | ||
cd /root/.cache/git-autoshare/github.com/odoo && \ | ||
/usr/bin/git init --bare && \ | ||
/usr/bin/git fetch https://github.com/OCA/OCB.git refs/heads/16.0:refs/git-autoshare/oca/heads/16.0 --shallow-since=2022-10-01 && \ | ||
/usr/bin/git fetch https://github.com/odoo/odoo.git refs/heads/16.0:refs/git-autoshare/odoo/heads/16.0 --shallow-since=2022-10-01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Odoo builder images | ||
|
||
These auxiliary images are designed to be used in a multi-stages Docker build. | ||
see https://docs.docker.com/build/building/multi-stage/ | ||
|
||
With traditional Odoo Dockerfiles, every time your base image get security updates (often once a week), all the Docker lines caches are swept and you rebuild the world, downloading 15 years of Odoo git history that weights 5.7 Gb. It can easily take 20 min in the cloud to 1h30 with a bad onsite connection... | ||
|
||
With these base images, we pack the bare git-autoshare object references minimum to make the build always fast and light: git history objects are never copied in the production image, only the <250 Mb worktree is. The auxiliary base image weights also no more than 280 Mb because we use fetch --shallow-since the release date: so we can get the Odoo PR merges without carrying the whole "fatty odoo" git repo. | ||
|
||
Cached builds still take less than 3 seconds while builds after security updates will not download anything from odoo/odoo, only copy the 250 Mb local worktree. And odoo-spec,yaml updates will not trigger large downloads either, only the git delta will be fetched. Most of these builds don't exceed 2 minutes. | ||
|
||
Only a standard Dockerfile, no host hack. |