在dockerfile中运行kapacitor localinstall的问题

时间:2016-08-31 04:07:52

标签: docker dockerfile kapacitor

我正在尝试在Cent-OS基础上安装Kapacitor,但是,当我构建dockerfile时,我遇到了执行localinstall命令(或者我认为)的问题。

我的dockerfile如下:

FROM centos-base:7   

ENV CONFIG_HOME /usr/local/bin

RUN curl -O https://dl.influxdata.com/kapacitor/releases/kapacitor-0.13.1.x86_64.rpm

RUN yum localinstall kapacitor-0.13.1.x86_64.rpm 

COPY kapacitor.conf $CONFIG_HOME
ENTRYPOINT["/bin/bash"]

当我构建它时,我得到以下响应:

Sending build context to Docker daemon 3.072 kB
Step 1 : FROM centos-base:7
 ---> 9ab68a0dd16a
Step 2 : ENV CONFIG_HOME /usr/local/bin
 ---> Running in ef5b7206e55d
 ---> 7c1b42d279db
Removing intermediate container ef5b7206e55d
Step 3 : RUN curl -O https://dl.influxdata.com/kapacitor/releases/kapacitor-0.13.1.x86_64.rpm
 ---> Running in 681bb29474f9
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 10.8M  100 10.8M    0     0   123k      0  0:01:29  0:01:29 --:--:--  224k
 ---> 99b4e77c89f2
Removing intermediate container 681bb29474f9
Step 4 : RUN yum localinstall kapacitor-0.13.1.x86_64.rpm
 ---> Running in d67ad03f4830
Loaded plugins: fastestmirror, ovl
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Examining kapacitor-0.13.1.x86_64.rpm: kapacitor-0.13.1-1.x86_64
Marking kapacitor-0.13.1.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package kapacitor.x86_64 0:0.13.1-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package        Arch        Version         Repository                     Size
================================================================================
Installing:
 kapacitor      x86_64      0.13.1-1        /kapacitor-0.13.1.x86_64       41 M

Transaction Summary
================================================================================
Install  1 Package

Total size: 41 M
Installed size: 41 M
Is this ok [y/d/N]: Exiting on user command
Your transaction was saved, rerun it with:
 yum load-transaction /tmp/yum_save_tx.2016-08-31.04-00.gvfpqf.yumtx
The command '/bin/sh -c yum localinstall kapacitor-0.13.1.x86_64.rpm' returned a non-zero code: 1

我哪里错了?我不能在Dockerfile中执行localinstall吗?谢谢!

1 个答案:

答案 0 :(得分:0)

替换

RUN yum localinstall kapacitor-0.13.1.x86_64.rpm 

RUN yum -y localinstall kapacitor-0.13.1.x86_64.rpm