You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Odoo Docker镜像脚手架搭建:V10版本如何复现scaffold命令?

How to Set Up Odoo Scaffold with Odoo 10 Docker Image

Hey there! Let's break down exactly how to run that odoo-bin scaffold openacademy addons command using the Odoo 10 Docker image, and make sure your scaffold files stick around after working with containers.

Prerequisites

First, make sure you've pulled the Odoo 10 Docker image if you haven't already:

docker pull odoo:10

Step 1: Prepare a Local Addons Directory

Docker containers are ephemeral by default—any files created inside them vanish when the container is deleted. To keep your scaffold module permanently, create a local directory on your host machine and set the right permissions (Odoo runs as user odoo with UID 1000 inside the container):

mkdir -p ./local-addons && chown -R 1000:1000 ./local-addons

Step 2: Run the Scaffold Command (Two Options)

You have two straightforward ways to execute the scaffold command:

Option 1: Use a Temporary Container (Clean & Quick)

This runs the command in a one-off container and deletes it right after, leaving your module in the local directory:

docker run --rm -v ./local-addons:/mnt/extra-addons odoo:10 odoo-bin scaffold openacademy /mnt/extra-addons
  • --rm: Automatically removes the container once the command finishes
  • -v ./local-addons:/mnt/extra-addons: Mounts your local directory to the container's /mnt/extra-addons path (a common spot for custom addons)
  • The final part is the actual scaffold command, pointing to the mounted directory so files save locally

Option 2: Enter a Running Container (For Ongoing Work)

If you already have an Odoo 10 container running (or want to keep one active), do this:

  1. Start a container with your local addons mounted (if you haven't already):
    docker run -d -v ./local-addons:/mnt/extra-addons --name my-odoo10 odoo:10
    
  2. Enter the container's shell:
    docker exec -it my-odoo10 bash
    
  3. Run the scaffold command inside the container, targeting the mounted directory:
    odoo-bin scaffold openacademy /mnt/extra-addons
    

Verify Your Module

Check your local ./local-addons directory—you should see the openacademy scaffold module with all the standard Odoo module files (models, views, controllers, etc.)!

内容的提问来源于stack exchange,提问作者Billal BEGUERADJ

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 07:34:02