官方EDK II Docker镜像,基于openEuler构建,提供现代化、跨平台的UEFI和PI规范固件开发环境,支持构建和测试UEFI应用,适用于固件开发与测试场景。

下载次数: 0状态:社区镜像维护者:openEuler 官方容器镜像仓库类型:镜像最近更新:1 个月前
下载命令
点击查看

Quick reference

  • The official EDK II docker image.

  • Maintained by: https://gitee.com/openeuler/cloudnative.

  • Where to get help: https://gitee.com/openeuler/cloudnative, https://gitee.com/openeuler/community.

EDK II | openEuler

Current EDK II docker images are built on the https://repo.openeuler.org/. This repository is free to use and exempted from per-user rate limits.

EDK II is a modern, feature-rich, cross-platform firmware development environment for the UEFI and PI specifications. EDK II is open source, using a BSD+Patent.

Learn more about EDK II on https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Documents⁠.

Supported tags and respective Dockerfile links

The tag of each edk2 docker image is consist of the version of edk2 and the version of basic image. The details are as follows

TagCurrentlyArchitectures
https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/edk2/202508.01/24.03-lts-sp4/Dockerfileedk2 202508.01 on openEuler 24.03-LTS-SP4amd64, arm64
https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/edk2/202608/24.03-lts-sp4/Dockerfileedk2 202608 on openEuler 24.03-LTS-SP4amd64, arm64
https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/edk2/202502/24.03-lts-sp1/DockerfileEDK II 202502 on openEuler 24.03-LTS-SP1amd64, arm64
https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/edk2/202505/24.03-lts-sp4/DockerfileEDK II 202505 on openEuler 24.03-LTS-SP4amd64, arm64

Usage

In this usage, users can select the corresponding {Tag} based on their requirements.

  • Pull the openeuler/edk2 image from docker

    bash
    docker pull openeuler/edk2:{Tag}
    
  • Step 1: Start a EDK II container instance

    By default, start the container with an interactive shell.

     docker run -it --privileged --device /dev/kvm --rm openeuler/edk2:{Tag}
    
    • --privileged: Grants the container elevated privileges, including access to all host devices and kernel capabilities. Required for QEMU/KVM acceleration.
    • --device /dev/kvm: Passes the host's /dev/kvm device to the container, allowing QEMU to use hardware-assisted virtualization (faster emulation).
  • Step 2: Initialize EDK II Environment

    This is a test environment: AArch64 (ARM 64-bit) on OpenEuler with QEMU

    source edksetup.sh
    
    • Sets up the EDK II build environment by configuring necessary paths (e.g., WORKSPACE, EDK_TOOLS_PATH).
    • Prepares Python scripts and toolchain variables for subsequent builds.
  • Step 3: Configure Build Target

    Modifications:

    TARGET_ARCH = AArch64
    TOOL_CHAIN_TAG = GCC5
    
    • AArch64 with GCC5 toolchain (Linux). For x86_64 hosts, set TARGET_ARCH=X64.
    • Ensures the build system generates ARM 64-bit binaries using GCC.
  • Step 4: Build HelloWorld UEFI Application

    The following example demonstrates how to build and use HelloWorld.

    build -p MdeModulePkg/MdeModulePkg.dsc \
      -m MdeModulePkg/Application/HelloWorld/HelloWorld.inf \
      -a AARCH64
    
    • Compiles the HelloWorld UEFI application from the EDK II MdeModulePkg.
    • Outputs:
      • Binary: /opt/edk2/Build/MdeModule/DEBUG_GCC5/AARCH64/HelloWorld.efi
      • Debug files and logs in the same directory.
  • Step 5: Install QEMU and Dependencies

    dnf install -y qemu-system-aarch64 wget 
    
    • Installs QEMU for AArch64 emulation and wget to download UEFI firmware.
    • Required to emulate an ARM-based UEFI environment.

    Download UEFI firmware:

    wget https://releases.linaro.org/components/kernel/uefi-linaro/latest/release/qemu64/QEMU_EFI.fd -O /opt/QEMU_EFI.fd
    
  • Step 6: Run HelloWorld in QEMU

    qemu-system-aarch64 \
      -machine virt \
      -cpu cortex-a57 \
      -bios /opt/QEMU_EFI.fd \
      -kernel /opt/edk2/Build/MdeModule/DEBUG_GCC5/AARCH64/HelloWorld.efi \
      -nographic \
      -monitor none \
      -serial stdio
    

    Parameters:

    • -machine virt: Emulates a generic ARM virtual machine.
    • -cpu cortex-a57: Specifies the CPU model.
    • -bios: Loads the UEFI firmware.
    • -kernel: Directly boots the HelloWorld.efi application.
    • -nographic -serial stdio: Redirects output to the current terminal.

    Expected Output:

    UEFI Hello World!
    .......
    

Question and answering

If you have any questions or want to use some special features, please submit an issue or a pull request on https://gitee.com/openeuler/openeuler-docker-images.

镜像拉取方式

您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

轩辕镜像加速拉取命令点我查看更多 edk2 镜像标签

docker pull docker.xuanyuan.run/openeuler/edk2:<标签>

DockerHub 原生拉取命令

docker pull openeuler/edk2:<标签>
专业版 · 高速稳定拉取镜像
50GB 仅 ¥8/年
高速镜像下载在线技术支持99.95% SLA 保障付费会员免广告