emqxarchive / emqx-docker

This repository is no longer maintained, please go to https://github.com/emqx/emqx-rel/tree/master/deploy/docker
Apache License 2.0
235 stars 162 forks source link

Can't get this to work on OpenShift #24

Open ertanden opened 7 years ago

ertanden commented 7 years ago

I'm trying to build this image and make it work on OpenShift, however the problem is that OpenShift runs containers with a special user id (like 100010000) and the user is in root group.

The problem can be locally reproduced with the following command:

docker run --rm -ti --name emqttd -e EMQ_WAIT_TIME=1000 -p 18083:18083 -p 1883:1883 -u 10001000:0 emqttd:latest

I made some changes to the start.sh to solve some problems (Mostly from this guide: OpenShift Guidelines) but seems like emqttd fails to start and there's not even a single log message. All I get is "waiting emqttd" and then it timeouts.

However, if I shell into this container, then I can succesfully run emqttd start and looks like it starts. However, the container still timeouts.

Quite stuck right now.

ertanden commented 7 years ago

If anybody is interested in the solution:

Follow this guide: OpenShift Guidelines

Also, more importantly have the following in your Dockerfile:

ENV HOME /opt/emqttd

Looks like Erlang cookie can't be created if $HOME is not available and it fails silently.

pablopani2002 commented 6 years ago

Hi,

I am also trying to deploy this image on Openshift but I cant seem to make I work. Could you paste your final Dockerfile here? At least the parts directly related to Openshift.

Thank you so much for your help.

emqplus commented 6 years ago

@pablopani2002 You can clone the project to check the Dockerfile and start.sh

pablopani2002 commented 6 years ago

@emqplus Hi, I already have the Dockerfile, but it does not work for Openshift. I keep geeting an error:


Node 'emq-23-2mxk7@master.mq.tt' not responding to pings.
['2018-02-22T07:30:38Z']:waiting emqttd
['2018-02-22T07:30:38Z']:timeout error

It has to do with Openshift not being able to run on root. I have tried with the guidelines @ertanden proposed, but it still gives the same error. Thanks so much for your help

PaoloCremonese commented 6 years ago

Hi, the error I get is that the directory /opt/emqttd/etc is empty, and the container logs shows continuously:

cat: can't open '/opt/emqttd/etc/emq.conf': No such file or directory

cat: can't open '/opt/emqttd/etc/plugins/*': No such file or directory