emqx-docker
emqx-docker copied to clipboard
Can't get this to work on OpenShift
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.
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.
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.
@pablopani2002 You can clone the project to check the Dockerfile
and start.sh
@emqplus Hi, I already have the Dockerfile, but it does not work for Openshift. I keep geeting an error:
Node '[email protected]' 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
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