建立Docker实例时如何安装本地rpm文件? [英] How to install a local rpm file when building docker instance?
本文介绍了建立Docker实例时如何安装本地rpm文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下docker文件,我想在我建立docker实例时,专门安装我的磁盘上可用的rpm文件。我调用rpm安装看起来像这样。命令
运行rpm -i chrpath-0.13-14.el7.x86_64.rpm
失败。
I have following docker file, I want to specifically install a rpm file that is available on my disk as I am building docker instance. My invocation of rpm install looks like this. Command
RUN rpm -i chrpath-0.13-14.el7.x86_64.rpm
fails.
有没有办法将rpm文件安装到新的Docker实例?
Is there a way to install rpm file available locally to new Docker instance?
FROM centos:latest
RUN yum -y install yum-utils
RUN yum -y install python-setuptools
RUN easy_install supervisor
RUN mkdir -p /var/log/supervisor
RUN yum -y install which
RUN yum -y install git
# Basic build dependencies.
RUN yum -y install autoconf build-essential unzip zip
# Gold linker is much faster than standard linker.
RUN yum -y install binutils
# Developer tools.
RUN yum -y install bash-completion curl emacs git man-db python-dev python-pip vim tar
RUN yum -y install gcc gcc-c++ kernel-devel make
RUN yum -y install swig
RUN yum -y install wget
RUN yum -y install python-devel
RUN yum -y install ntp
RUN rpm -i chrpath-0.13-14.el7.x86_64.rpm
推荐答案
将此行放在 rpm -i
命令:
ADD /host/abs/path/to/chrpath-0.13-14.el7.x86_64.rpm /chrpath-0.13-14.el7.x86_64.rpm
然后你可以执行
RUN rpm -i chrpath-0.13-14.el7.x86_64.rpm
这篇关于建立Docker实例时如何安装本地rpm文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文