Contributors mailing list archives

contributors@odoo-community.org

Browse archives

Avatar

Re: problems using camptocamp/docker-odoo-project

by
Camptocamp SA, Yannick Payot
- 03/01/2017 16:33:54
Hello Robert,

Each time a ONBUILD COPY command is there the mentionned directory or file must exists.

About your error, I think that your issue is that your odoo/src is empty.

In fact odoo/src should contain the code of your odoo version.


When building the image, local odoo/src content will be copied to image /opt/odoo/src

This is what you should have:

$ tree . -L 3
. (your project folder also git repository root)
├── docker-compose.yml
├── odoo
│   ├── data
│   │  
── images
│   ├── Dockerfile
│   ├── external-src
│   │   ├── l10n-switzerland (
git@github.com:OCA/l10n-switzerland)

[...]

│   │   └── server-tools
(git@github.com:OCA/server-tools)
│   ├── local-src
│   │   └── customer_addons
│   ├── migration.yml
│   ├── requirements.txt
│   ├── setup.py
│   ├── songs
│   │   ├── common.py
│   │   ├── __init__.py
│   │   └── install
│   ├── src (git@github.com/odoo/odoo) <-- check this folder is not empty
│   │   ├── addons
│   │   ├── CONTRIBUTING.md
│   │   ├── COPYRIGHT
│   │   ├── debian
│   │   ├── doc
│   │   ├── LICENSE
│   │   ├── Makefile
│   │   ├── MANIFEST.in
│   │   ├── odoo.egg-info
│   │   ├── odoo.py
│   │   ├── openerp
│   │   ├── openerp-gevent
│   │   ├── openerp-server
│   │   ├── openerp-wsgi.py
│   │   ├── README.md
│   │   ├── requirements.txt
│   │   ├── setup
│   │   ├── setup.cfg
│   │   └── setup.py
│   └── VERSION
├── README.md
[...]

Before you did
git submodule init
did you do a git init to create your local repository?

Also you could try to use docker compose.

docker-compose odoo build

instead of `docker build .`




Regards and happy new year,

Yannick Vaucher
Business Solutions Software Developer

Camptocamp SA
PSE A, CH-1015 Lausanne
Phone: +41 21 619 10 30
Office: +41 21 619 10 10

On 30 December 2016 at 13:08, robert rottermann <robert@redcor.ch> wrote:

Hi there,

I try to understand the usage of camptocamp/docker-odoo-project.

So I created a structure according to the sample given at:
https://github.com/camptocamp/docker-odoo-project/tree/master/example

but somehow I have problems with the file structure.

When I setup things like suggested:
mkdir -p odoo/external-src odoo/local-src odoo/data odoo/features
git submodule init
git submodule add -b 9.0 https://github.com/odoo/odoo.git  odoo/src

then I add the minimal Dockerfile as suggested with the following content:

FROM camptocamp/odoo-project:9.0
MAINTAINER <name>

ENV ADDONS_PATH=/opt/odoo/local-src,/opt/odoo/external-src/server-tools,/opt/odoo/src/addons


And start the build:
docker build .

However I get problems as soon as docker starts to run the ONBUILD steps
 defined in the  parent Dockerfile:
# intermediate images should help speed up builds when only local-src, or only
# external-src changes
ONBUILD COPY ./src /opt/odoo/src
ONBUILD COPY ./external-src /opt/odoo/external-src
ONBUILD COPY ./local-src /opt/odoo/local-src
ONBUILD COPY ./data /opt/odoo/data
ONBUILD COPY ./songs /opt/odoo/songs
ONBUILD COPY ./setup.py /opt/odoo/
ONBUILD COPY ./VERSION /opt/odoo/
ONBUILD COPY ./migration.yml /opt/odoo/
# need to be called at the end, because it installs . and src
ONBUILD RUN cd /opt/odoo && pip install -r src_requirements.txt

None of the above documents exist. Either they are missing at all, or like ./src it is in odoo/src.
So I move the Dockerfile to the folder odoo, add all the missing files, and start to build the image again.

This time it runs much further.
Only in the very last step:
# need to be called at the end, because it installs . and src
ONBUILD RUN cd /opt/odoo && pip install -r src_requirements.txt

the process fails because the install scripts expects requirements.txt to be in /opt/odoo/odoo
Step 1 : RUN cd /opt/odoo && pip install -r src_requirements.txt
 ---> Running in 82f92d70e180
Obtaining file:///opt/odoo (from -r src_requirements.txt (line 7))
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/opt/odoo/setup.py", line 11, in <module>
        execfile(join(dirname(__file__), 'odoo', 'release.py'))  # Load release variables
    IOError: [Errno 2] No such file or directory: '/opt/odoo/odoo/release.py'
   
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /opt/odoo/
The command '/bin/sh -c cd /opt/odoo && pip install -r src_requirements.txt' returned a non-zero code: 1

So how do I have to setup things?

thanks very much for your pointers

robert

thanks very much for all your work
and happy new year!

_______________________________________________
Mailing-List: http://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: http://odoo-community.org/groups?unsubscribe


Reference