# Converting an Ubuntu based Dockerfile to CentOS fails

**URL:** <https://discuss.elastic.co/t/converting-an-ubuntu-based-dockerfile-to-centos-fails/116727>\
**Category:** Logstash\
**Created:** [January 23, 2018, 6:29pm UTC](https://discuss.elastic.co/t/converting-an-ubuntu-based-dockerfile-to-centos-fails/116727 "2018-01-23T18:29:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tezarin](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@tezarin](https://discuss.elastic.co/u/tezarin)\
**Post date:** [January 23, 2018, 6:29pm UTC](https://discuss.elastic.co/t/converting-an-ubuntu-based-dockerfile-to-centos-fails/116727/1 "2018-01-23T18:29:23Z")

</div>

Hi all,

I have successfully building the sebp/elk image which is based on an Ubuntu image: [https://hub.docker.com/r/sebp/elk/~/dockerfile/](https://hub.docker.com/r/sebp/elk/~/dockerfile/) and I can run the container by running this command:

sudo docker run -p 5601:5601 -p 9200:9200 -p 5000:5000 -it --name elk sebp/elk

I am trying to convert the Dockerfile so it uses a CentOS base image instead of Ubuntu base image, so I replaced the first section:

Before  
FROM phusion/baseimage  
MAINTAINER Sebastien Pujadas [http://pujadas.net](http://pujadas.net)  
ENV REFRESHED\_AT 2017-01-13  
ENV GOSU\_VERSION 1.8

RUN set -x  
&& apt-get update -qq  
&& apt-get install -qqy --no-install-recommends ca-certificates curl  
&& rm -rf /var/lib/apt/lists/\*  
&& curl -L -o /usr/local/bin/gosu “[https://github.com/tianon/gosu/releases/download/$GOSU\_VERSION/gosu-$](https://github.com/tianon/gosu/releases/download/%24GOSU_VERSION/gosu-%24)(dpkg --print-architecture)”  
&& curl -L -o /usr/local/bin/gosu.asc “[https://github.com/tianon/gosu/releases/download/$GOSU\_VERSION/gosu-$](https://github.com/tianon/gosu/releases/download/%24GOSU_VERSION/gosu-%24)(dpkg --print-architecture).asc”  
&& export GNUPGHOME="$(mktemp -d)"  
&& gpg --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4  
&& gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu  
&& rm -r “$GNUPGHOME” /usr/local/bin/gosu.asc  
&& chmod +x /usr/local/bin/gosu  
&& gosu nobody true  
&& apt-get update -qq  
&& apt-get install -qqy openjdk-8-jdk  
&& apt-get clean  
&& set +x

After  
FROM centos:latest  
ENV GOSU\_VERSION 1.10

RUN set -x  
&& yum update -y  
&& yum -y install epel-release  
&& yum install -y ca-certificates curl dpkg  
&& curl -L -o /usr/local/bin/gosu “[https://github.com/tianon/gosu/releases/download/$GOSU\_VERSION/gosu-$](https://github.com/tianon/gosu/releases/download/%24GOSU_VERSION/gosu-%24)(dpkg --print-architecture)”  
&& curl -L -o /usr/local/bin/gosu.asc “[https://github.com/tianon/gosu/releases/download/$GOSU\_VERSION/gosu-$](https://github.com/tianon/gosu/releases/download/%24GOSU_VERSION/gosu-%24)(dpkg --print-architecture).asc”  
&& export GNUPGHOME="$(mktemp -d)"  
&& gpg --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4  
&& gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu  
&& rm -r “$GNUPGHOME” /usr/local/bin/gosu.asc  
&& chmod +x /usr/local/bin/gosu  
&& gosu nobody true  
&& yum update -y  
&& yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel  
&& yum clean all  
&& set +x

The image builds successfully but when I try to run it with the same docker run command (above), I get errors:

[2018-01-23T17:06:38,250][ERROR][logstash.inputs.beats] Invalid setting for beats input plugin:

input {  
beats {

# This setting must be a path

# File does not exist or cannot be opened /etc/pki/tls/private/logstash-beats.key

ssl\_key =\> “/etc/pki/tls/private/logstash-beats.key”  
…  
}  
}  
[2018-01-23T17:06:38,325][ERROR][logstash.agent] Failed to execute action {:action=\>LogStash::PipelineAction::Create/pipeline\_id:main, :exception=\>“LogStash::ConfigurationError”, :message=\>“Something is wrong with your configuration.”, :backtrace=\>["/opt/logstash/logstash-core/lib/logstash/config/mixin.rb:89:in config\_init'", "/opt/logstash/logstash-core/lib/logstash/inputs/base.rb:62:ininitialize’", “/opt/logstash/logstash-core/lib/logstash/plugins/plugin\_factory.rb:90:in plugin'", "/opt/logstash/logstash-core/lib/logstash/pipeline.rb:114:inplugin’”, “(eval):8:in '", "org/jruby/RubyKernel.java:994:ineval’”, “/opt/logstash/logstash-core/lib/logstash/pipeline.rb:86:in initialize'", "/opt/logstash/logstash-core/lib/logstash/pipeline.rb:171:ininitialize’”, “/opt/logstash/logstash-core/lib/logstash/pipeline\_action/create.rb:40:in execute'", "/opt/logstash/logstash-core/lib/logstash/agent.rb:335:inblock in converge\_state’”, “/opt/logstash/logstash-core/lib/logstash/agent.rb:141:in with\_pipelines'", "/opt/logstash/logstash-core/lib/logstash/agent.rb:332:inblock in converge\_state’”, “org/jruby/RubyArray.java:1734:in each'", "/opt/logstash/logstash-core/lib/logstash/agent.rb:319:inconverge\_state’”, “/opt/logstash/logstash-core/lib/logstash/agent.rb:166:in block in converge\_state\_and\_update'", "/opt/logstash/logstash-core/lib/logstash/agent.rb:141:inwith\_pipelines’”, “/opt/logstash/logstash-core/lib/logstash/agent.rb:164:in converge\_state\_and\_update'", "/opt/logstash/logstash-core/lib/logstash/agent.rb:90:inexecute’”, “/opt/logstash/logstash-core/lib/logstash/runner.rb:343:in block in execute'", "/opt/logstash/vendor/bundle/jruby/2.3.0/gems/stud-0.0.23/lib/stud/task.rb:24:inblock in initialize’”]}

I have tried it with gosu version 1.8 and 1.10 and both have the same error. Can you please help me figure out what I am doing wrong?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 20, 2018, 6:29pm UTC](https://discuss.elastic.co/t/converting-an-ubuntu-based-dockerfile-to-centos-fails/116727/2 "2018-02-20T18:29:30Z")

</div>

Closed on February 20, 2018, 6:29pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
