Dockerfile:无法运行bin命令ubuntu [英] Dockerfile: not able to run bin command ubuntu

查看:35
本文介绍了Dockerfile:无法运行bin命令ubuntu的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图安装elasticsearch并在我的dockerfile中遇到错误.看来它无法运行bin.

Ubuntu上的

  #JDK 1.8 for ElasticSearch运行add-apt-repository -y ppa:webupd8team/java运行apt-get -y更新运行apt-get -y install openjdk-8-jre运行wget -qO – https://artifacts.elastic.co/GPG-KEY-elasticsearch |apt键添加–运行apt-get install apt-transport-httpsRUN echo"deb https://artifacts.elastic.co/packages/6.x/apt稳定主程序" |tee -a/etc/apt/sources.list.d/elastic-6.x.list运行apt更新运行apt-get install elasticsearch运行/usr/share/elasticsearch/bin/elasticsearch-plugin安装分析-icu运行/usr/share/elasticsearch/bin/elasticsearch-plugin安装分析-语音RUN -service elasticsearch启动运行gedit/etc/elasticsearch/jvm.options运行gedit/etc/elasticsearch/elasticsearch.ymlRUN curl -XGET‘http://localhost:9200/_cat/health?v& pretty’ 


 第21/70步:运行wget -qO – https://artifacts.elastic.co/GPG-KEY-elasticsearch |apt键添加–--->在7558b8a264b8中运行警告:不应解析apt-key输出(stdout不是终端)gpg:找不到有效的OpenPGP数据.命令'/bin/sh -c wget -qO – https://artifacts.elastic.co/GPG-KEY-elasticsearch |apt-key add –'返回了非零代码:2 

码头工人的新事物,所以我们将不胜感激.我正在运行root用户,因此不需要在任何这些命令前添加sudo.

解决方案

安装这样的密钥似乎存在问题.此处此处.

建议的解决方案是像这样拆分命令:

  wget -q https://artifacts.elastic.co/GPG-KEY-elasticsearchapt-key添加GPG-KEY-elasticsearch 

在您的情况下,我怀疑 wget 命令的输出不是 GPG 键.可能是其他原因(例如代理响应)或错误.尝试删除静默标志( -q )以查看实际情况.

希望有帮助.

Trying to get elasticsearch installed and running into an error here in my dockerfile. Looks like it's unable to run bin.

#JDK 1.8 on Ubuntu for ElasticSearch
RUN add-apt-repository -y ppa:webupd8team/java
RUN apt-get -y update
RUN apt-get -y install openjdk-8-jre
RUN wget -qO – https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add –
RUN apt-get install apt-transport-https
RUN echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-6.x.list
RUN apt-get update
RUN apt-get install elasticsearch
RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install analysis-icu
RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install analysis-phonetic
RUN -service elasticsearch start
RUN gedit /etc/elasticsearch/jvm.options
RUN gedit /etc/elasticsearch/elasticsearch.yml
RUN curl -XGET ‘http://localhost:9200/_cat/health?v&pretty’


Step 21/70 : RUN wget -qO – https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add –
 ---> Running in 7558b8a264b8
Warning: apt-key output should not be parsed (stdout is not a terminal)
gpg: no valid OpenPGP data found.
The command '/bin/sh -c wget -qO – https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add –' returned a non-zero code: 2

Kind of new to docker so any help would be greatly appreciated. I'm running root user so i don't need to add sudo in front of any of these commands.

解决方案

It seems there is an issue installing the keys like that. Similar problem here and here.

The suggested solution is to split the command like this:

wget -q https://artifacts.elastic.co/GPG-KEY-elasticsearch
apt-key add GPG-KEY-elasticsearch

In your case, I suspect the output of the wget command is not the GPG key. It might be something else (e.g. proxy response) or an error. Try to remove the silent flag (-q) to see what's really going on.

Hope that helps.

这篇关于Dockerfile:无法运行bin命令ubuntu的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆