I have set the Odoo docker container in my local machine and I am able to run the Odoo server. But I want to create custom modules. How do I access the Odoo source code inside the container image and make some changes?
Asked
Active
Viewed 3,094 times
3
-
Mount a [volume](https://docs.docker.com/storage/volumes/)! – Klaus D. Nov 07 '18 at 11:02
-
Possible duplicate of [How to mount a host directory in a Docker container](https://stackoverflow.com/questions/23439126/how-to-mount-a-host-directory-in-a-docker-container) – Klaus D. Nov 07 '18 at 11:03
-
insted of mounting can't i update the odoo code which is there in the odoo image ? – Sravan kunnummal. Nov 07 '18 at 11:10
1 Answers
1
I think you can build a docker image for yourself. If you want to add your module into Odoo image and don't want to mount it in your command line or write it into docker-compose file.
It's mean that you need to create your docker image.
Create Dockerfile like this: https://github.com/odoo/docker/tree/master/11.0
With this code, you can create directory and mount it into your image.
RUN mkdir -p /mnt/extra-addons \ && chown -R odoo /mnt/extra-addons VOLUME ["/var/lib/odoo", "/mnt/extra-addons"]
FYI: This is tutorial to create image: https://docs.docker.com/develop/develop-images/baseimages/
Hope it will help you.

Lê Duy Tân
- 21
- 2