Setting Up the Development Environment with Docker
更新时间: 2025/12/28
在Gitcode上查看源码

The openUBMC community provides a ready-to-use Docker image that lets you skip all the tricky setup steps. With Docker's power, you can jump straight into actual development work. We've got installation guides tailored for different operating systems.

TIP

If you use openUBMC Studio, once Docker is installed, you can take advantage of its built-in Docker container management to pull images, create containers, and connect remotely — all from within Studio without manual command-line steps. See the openUBMC Studio Installation Guide for details.

  1. Windows, Mac or Ubuntu Desktop users → see Installing Docker Desktop
  2. Ubuntu Sever or other Linux distributions → see Installing Docker CE

NOTE

Always refer to the official Docker Engine installation docs for the latest guidance: https://docs.docker.com/engine/install/

Installing Docker

  1. Head to the Docker website and grab the latest Docker Desktop release: https://www.docker.com/products/docker-desktop/
  2. Follow the installer wizard to get it set up.
  3. Once it's done, open your terminal and run docker ps to check that everything works.
shell
> docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

Docker CE is the Linux-native version. Most distro repos don't include it by default, so you need to add Docker's repository first. We'll use Ubuntu (amd64) as the example here. For other distros, check the official docs: https://docs.docker.com/engine/install/

NOTE

Steps adapted from Huawei Cloud mirror guide

  1. If you've got an older or different Docker version installed, clean it up first. You can check with docker version—if you see Server: Docker Engine - Community, you're good and can skip installation.

    bash
    sudo apt-get remove docker docker-engine docker.io
  2. Install dependencies:

    bash
    sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common
  3. Add Docker's GPG key:

    bash
    curl -fsSL https://mirrors.huaweicloud.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
  4. Add the repository:

    bash
    sudo add-apt-repository "deb [arch=amd64] https://mirrors.huaweicloud.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
  5. Install Docker CE:

    bash
    sudo apt-get update
    sudo apt-get install docker-ce
  6. Verify with docker ps:

    bash
    > docker ps
    CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

Option 2: Install from official Docker repositories

Feel free to use the official sources instead. Full details here: https://docs.docker.com/engine/install/ubuntu/

Pulling the openUBMC Development Docker Image

Once Docker is ready, grab the openUBMC image to get your environment directly.

  1. Pull the image:

    bash
    docker pull swr.cn-north-4.myhuaweicloud.com/openubmc/ubuntu:24.04.2_25.09
  2. Check that it downloaded correctly:

    bash
    > docker image ls
    REPOSITORY                                         TAG       IMAGE ID       CREATED       SIZE
    swr.cn-north-4.myhuaweicloud.com/openubmc/ubuntu   24.04.2_25.09   --   3 days ago    2.33GB

Option 2: Build the image locally (for offline or custom SDK needs)

If you need a specific SDK version or can't reach public registries, check the README in the manifest repo. It includes an automated script to build the image locally.

This approach uses Docker BuildKit's secure --mount=type=secret feature, so your Conan credentials are only temporarily available during the build and get cleaned up afterward—no traces left in the image history.


Creating a Container Instance

  1. Create a workspace folder on the host to share files between host and container (great for managing code and build artifacts). Example on Linux:

    bash
    mkdir /root/workspace

    If you're on Windows with Docker Desktop, just make a similar folder in Windows.

  2. Start a detached container named openubmc:

    bash
    docker run -itd --privileged=true --mount type=bind,source=/root/workspace,target=/home/workspace  --name openubmc swr.cn-north-4.myhuaweicloud.com/openubmc/ubuntu:24.04.2_25.09 /bin/bash
    
    docker run -itd --privileged=true\
    -p <BMC Studio service port>:10000 \
    -p <qemu ssh external port>:<qemu ssh container port> \
    ...
    --mount type=bind,source=/root/workspace,target=/home/workspace \
    --restart=always --name openubmc swr.cn-north-4.myhuaweicloud.com/openubmc/ubuntu:24.04.2_25.09 /bin/bash

    Param descriptions:

     - `-itd`: Runs the container in the background so you can reuse it for multiple builds.
     - `--privileged=true`: Gives real root privileges inside the container.
     - `-p`: Configures port mapping for the container. Configure as needed. For example, BMC Studio's default port is 10000; qemu's ssh service defaults to 10022, telnet port defaults to 10023, https service port defaults to 10443, and ipmi service port defaults to 10623.
     - `--mount`: Binds your host workspace to /home/workspace inside the container for easy file sharing.
     - `--restart=always`: Automatically starts the container when the system reboots.
     - `--name`: Defines the container name.
    
  3. Check if the container is running:

    bash
    > docker ps
    CONTAINER ID   IMAGE                                                              COMMAND          CREATED              STATUS              PORTS     NAMES
    7e83bed8fcfe   swr.cn-north-4.myhuaweicloud.com/openubmc/ubuntu:24.04.2_25.09   "/bin/bash"   About a minute ago   Up About a minute             openubmc
  4. Jump inside the container:

    bash
    docker exec -it openubmc /bin/bash
    bash
    > ls
    bin  boot  dev  etc  home  lib  lib32  lib64  libx32  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var

    You'll see the usual Linux root filesystem. Type exit when you're done.

    bash
    exit

    You can always get back in with the same docker exec command.

Managing the Container

After rebooting your host OS, the container will be stopped. Just start it again:

bash
docker start openubmc

You can check if the container is the same one via docker ps.

bash
> docker ps
CONTAINER ID   IMAGE                                                              COMMAND          CREATED              STATUS              PORTS     NAMES
7e83bed8fcfe   swr.cn-north-4.myhuaweicloud.com/openubmc/ubuntu:24.04.2_25.09  "/bin/bash"   About a minute ago   Up About a minute             openubmc

Setting Up the Remote Conan Service Inside the Container

openUBMC upgrades and component builds rely on pre-built Conan artifacts hosted on a remote Conan server. You'll need to configure access inside the container.

For components published in 25.09 and later (uses Conan 2.x)

sdk conan remote命名遵循 https://conan.openubmc.cn/bmc_sdk_{版本号},如 25.12 对应 https://conan.openubmc.cn/bmc_sdk_25.12 25.12_LTS-SP1 对应 https://conan.openubmc.cn/bmc_sdk_25.12-LTS-SP1 latest一般为最新版本,如最新为25.12,https://conan.openubmc.cn/bmc_sdk_latest等同https://conan.openubmc.cn/bmc_sdk_25.12

bash
conan profile detect --force

conan remote add openubmc_sdk 'https://conan.openubmc.cn/bmc_sdk_latest' --insecure --force
conan remote login openubmc_sdk <openUBMC社区用户> -p <openUBMC社区用户密>

conan remote add openubmc_opensource 'https://conan.openubmc.cn/openubmc_opensource' --insecure --force
conan remote login openubmc_opensource<openUBMC社区用户> -p <openUBMC社区用户密>

For components published before 25.09 (uses Conan 1.x)

bash
conan config init
conan remote add openubmc_dev "https://conan.openubmc.cn/conan_1/" false -f
conan user <openUBMC社区用户> -p=<openUBMC社区用户密码> -r openubmc_dev

FAQ

If you run into Docker-related problems, check out the FAQ section or post in the community forum for help.