用于通过SSL支持构建uWSGI的Dockerfile

时间:2018-11-26 14:51:16

标签: docker ssl uwsgi

我正在使用uWSGI构建Docker容器,并使用以下#!/usr/bin/env python3 import subprocess import numpy as np from PIL import Image palette = [ 0,0,0, 0,0,255, 15,29,15, 26,141,52, 41,41,41, 65,105,225, 85,11,18, 128,0,128, 135,206,236, 144,238,144, 159,30,81, 165,42,42, 166,141,95, 169,169,169, 173,216,230, 211,211,211, 230,208,122, 245,245,220, 247,214,193, 255,0,0, 255,165,0, 255,192,203, 255,255,0, 255,255,255 ] + [0,] * 232 * 3 # Write "map.png" that is a 24x1 pixel image with one pixel for each colour entries = 24 resnp = np.arange(entries,dtype=np.uint8).reshape(24,1) resim = Image.fromarray(resnp, mode='P') resim.putpalette(palette) resim.save('map.png') # Use Imagemagick to remap to palette saved above in 'map.png' # magick lion.png +dither -quantize Lab -remap map.png result.png subprocess.run(['magick', 'lion.png', '+dither', '-quantize', 'Lab', '-remap', 'map.png', 'result.png']) 指令(相关摘录):

Dockerfile

稍后,当调用WebSocket时,我遇到此错误消息:

  

您需要使用SSL支持构建uWSGI才能使用websocket   握手api函数

如何在基于Debian的Docker映像的上下文中构建具有SSL支持的uWSGI?

1 个答案:

答案 0 :(得分:1)

以下内容适用于我:

Dockerfile

this个相关的答案帮助了我。我还必须克服仅在{{1}}的较晚部分安装了OpenSSH的烦恼:这似乎使SSH库似乎可用于uWSGI编译步骤,而实际上它们在安装过程中尚不存在。那一步。 This答案对于从命令行测试生成的Web套接字很有用。