【问题标题】:Problems running kapacitor localinstall inside dockerfile在 dockerfile 中运行 kapacitor localinstall 的问题
【发布时间】:2017-01-07 12:15:35
【问题描述】:

我正在尝试在 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 吗?谢谢!

【问题讨论】:

    标签: docker dockerfile kapacitor


    【解决方案1】:

    替换

    RUN yum localinstall kapacitor-0.13.1.x86_64.rpm 
    

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

    【讨论】:

    • 谢谢。那行得通。但是,现在,最后一条指令似乎存在一些问题,因为它给出了错误“未知指令:ENTRYPOINT [“/BIN/BASH”]`。我在那里做错了吗?
    • @RohanSingh 你必须在ENTRYPOINT['/bin/bash'] 之间放置一个空格
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-05
    • 2018-03-28
    • 2017-05-07
    • 2018-05-19
    • 2020-08-20
    相关资源
    最近更新 更多