Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Websockets support not available on containerized Alpine #2562

Closed
bertmelis opened this issue Jun 10, 2022 · 3 comments
Closed

Websockets support not available on containerized Alpine #2562

bertmelis opened this issue Jun 10, 2022 · 3 comments

Comments

@bertmelis
Copy link

I'm trying to run mosquitto in an Alpine container but it says websockets support is not available:

1654862199: Error: Websockets support not available.

1654862199: Error found at /mqtt/mosquitto.conf:38.

Line 37 and 38 of the mosquitto.conf are

listener 8083
protocol websockets

The containerfile is very straightforward:

FROM alpine:latest
RUN addgroup -g 1000 mqttgroup && \
    adduser -G mqttgroup -u 1000 -h /mqtt -D mqttuser && \
    apk --no-cache add mosquitto
WORKDIR /mqtt
COPY data/ /mqtt/
RUN chown -R mqttuser:mqttgroup /mqtt
USER mqttuser
RUN mosquitto_passwd -U /mqtt/passwd
EXPOSE 1883 8883 8083 8084
CMD ["mosquitto", "-c", "/mqtt/mosquitto.conf"]

Explicitely installing libwebsockets doesn't improve.

Versions are (taken from build log):

  • Alpine 3.16
  • libwebsockets (4.3.1-r0)
  • c-ares (1.18.1-r0)
  • mosquitto-libs (2.0.14-r0)
  • mosquitto (2.0.14-r0)
@bertmelis
Copy link
Author

Meanwhile I switched to the official docker image and obviously the error is gone. The "only" difference I see is that I used latest Alpine (=3.16) and your official mosquitto image uses Alpine 3.14

@hardillb
Copy link
Contributor

You are installing Alpines build of mosquitto, where as the offical mosquitto images build on top of Alpine.

So the difference is that Alpines build of mosquitto hasn't set the flag to enable websockets.

@bertmelis
Copy link
Author

Ah. They must have changed it then.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants