docker icon indicating copy to clipboard operation
docker copied to clipboard

Support versioned tags

Open ZerNox opened this issue 2 years ago • 9 comments

When you want to base this image as a multistage build it would be very useful to have a version on the odoo docker image.

Suggestion: odoo:14.0-20210903

ZerNox avatar Sep 07 '21 10:09 ZerNox

@ZerNox you can add '"local" tag after pulling an image (version from Dockerfile) docker tag odoo:14.0 odoo:14.0-XXXXYYZZ

arabkhemar avatar Oct 08 '21 11:10 arabkhemar

+1 for this issue.

@arabkhemar You can't create identical environmental with local tags because odoo:14.0 can be different at different times. And you should use digests instead of tags, which are not convenient.

avkhozov avatar Jan 07 '22 07:01 avkhozov

There is also a problem with getting a consistent instance with Odoo Enterprise in a docker environment https://github.com/odoo/docker/issues/392#issuecomment-1007707903. It seems that proper versioning can solve this problem as well.

avkhozov avatar Jan 10 '22 07:01 avkhozov

@d-fence, is there a chance that docker's tags with odoo's releases will appear in the official registry https://hub.docker.com/_/odoo?

avkhozov avatar Jan 21 '22 07:01 avkhozov

TLDR: docker-library/repo-info contains sufficient digests/versions for a decent workaround

If you check out the history for repos/odoo, you will notice the commit messages run either "scan-local.sh" or "update-remote.sh".

The update remote changes contain docker digests:

$ docker pull odoo@sha256:ea7a1bfeb448ea7d3a2a9724b2153bb409bfa5b0085bf18531d5e928eac8efd0

and the scan local changes contain package version updates:

  • odoo=13.0.20220325

This means that for any given commit, you can reasonably work around the lack of minor version tagging in Docker Hub with a short script:

export ODOO_DIGEST="sha256:ea7a1bfeb448ea7d3a2a9724b2153bb409bfa5b0085bf18531d5e928eac8efd0"
export ODOO_VERSION="13.0.20220325"
docker pull odoo@$ODOO_DIGEST
docker tag odoo@$ODOO_DIGEST odoo@$ODOO_VERSION
...rest of your build...

The information currently exists for Odoo versions 13.0 through 15.0 and the digests can be successfully pulled from Docker Hub.

Edit: It looks like there is some drift between the update remote and scan local commits. I just instantiated the June 9th digest and dpkg -s odoo | grep Version shows 15.0.20220609, not the 15.0.20220531 of the prior scan local. So I guess the cron jobs are running on whatever schedule, but the docker images are built nightly.

amh-mw avatar Sep 07 '22 14:09 amh-mw

Given that each image has a major.minor.date version Odoo package, it seems like it should be trivial to also tag the docker image with that version.

amh-mw avatar Sep 07 '22 14:09 amh-mw

I see devs have been asking about this for over year along with offering possible fixes. Is anyone from Odoo reading these tickets?

ar-mw avatar Sep 08 '22 15:09 ar-mw

That is important,... please odoo, do this!

MartinVerges avatar Jan 02 '23 10:01 MartinVerges

@ar-mw I am wildly assuming there is no one tasked with issues in this repo. The goal of OP can be done on the build system of OP if desired. The lack of resources to address features here is an all to common issue. I guess someone could look for the build/push automation and add PR to do this. A quick check of odoo/odoo and we as a community need to help on issues.

lathama avatar Apr 02 '24 18:04 lathama