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

Docker构建RedHat镜像时无法找到boost-program-options包求助

解决UBI8容器中安装MariaDB时boost-program-options找不到的问题

直接解决方案:修改Dockerfile,移除手动指定的多余依赖

不需要手动安装boost-program-options等依赖,dnf会自动处理MariaDB的依赖链。修改后的Dockerfile如下:

# Base image
FROM redhat/ubi8:latest

# 更新包并安装curl
RUN dnf update -y \
    && dnf install -y curl \
    && dnf clean all

# 添加MariaDB仓库
RUN curl -LsS -O https://downloads.mariadb.com/MariaDB/mariadb_repo_setup \
    && bash mariadb_repo_setup \
    && rm mariadb_repo_setup

# 安装MariaDB Server,dnf自动拉取所需依赖
RUN dnf install -y --repo="mariadb-main" MariaDB-server \
    && dnf clean all

问题原因

  1. UBI8的包模块机制:boost-program-options属于UBI8的boost软件模块,默认状态下该模块未启用,直接执行dnf install会找不到对应包。
  2. 手动指定依赖多余:安装MariaDB-server时,dnf会自动解析并安装所有必要的依赖组件,包括boost-program-options、perl-DBI等,无需手动提前安装。

若需单独安装boost-program-options的操作

如果确实需要单独安装该包,需先启用boost模块:

RUN dnf module enable -y boost \
    && dnf install -y boost-program-options \
    && dnf clean all

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.26 16:32:37