0

I am building a Docker container with uWSGI with the following Dockerfile instructions (relevant excerpt):

FROM debian:stretch
RUN apt-get update && \
  apt-get install --no-install-recommends --no-install-suggests -y \
  gcc python3 python3-dev python3-pip python3-setuptools
RUN pip3 install wheel
RUN pip3 install uwsgi

Later on, when invoking the WebSocket I encounter this error message:

you need to build uWSGI with SSL support to use the websocket handshake api function

How I can build uWSGI with SSL support in the context of a Debian-based Docker image?

rookie099
  • 2,201
  • 2
  • 26
  • 52

1 Answers1

1

The following now works for me:

FROM debian:stretch
RUN apt-get update && \
  apt-get install --no-install-recommends --no-install-suggests -y \
  gcc libssl-dev python3 python3-dev python3-pip python3-setuptools
RUN pip3 install wheel
RUN CFLAGS="-I/usr/local/opt/openssl/include" LDFLAGS="-L/usr/local/opt/openssl/lib" \
  UWSGI_PROFILE_OVERRIDE=ssl=true pip3 install uwsgi -Iv

I was helped by this related answer. I also had to overcome an irritation that stemmed from having installed OpenSSH only in a later part of the Dockerfile: this made it seem as if SSH libraries were available to the uWSGI compilation step when in reality they were not yet present during that step. This answer was useful for testing the resulting web socket from a command line.

rookie099
  • 2,201
  • 2
  • 26
  • 52