2017-07-09 106 views
0

我試圖從一個叉建立一個碼頭工人,我收到以下錯誤執行docker build ./時:錯誤時nginx的搬運工

cc1: all warnings being treated as errors 
make[1]: *** [objs/src/event/ngx_event_openssl.o] Error 1 
objs/Makefile:748: recipe for target 'objs/src/event/ngx_event_openssl.o' failed 
make[1]: Leaving directory '/tmp/nginx/nginx-1.8.0' 
make: *** [install] Error 2 

上安裝我們運行

apt-get -y install libpcre3-dev zlib1g-dev libssl-dev openssl build-essential wget 

我可以」在谷歌上找到這個錯誤。參考完整的錯誤,因爲我無法找到準確的錯誤引用我需要研究:

src/event/ngx_event_openssl.c: In function 'ngx_ssl_init': 
src/event/ngx_event_openssl.c:112:5: error: 'OPENSSL_config' is deprecated [-Werror=deprecated-declarations] 
    OPENSSL_config(NULL); 
    ^~~~~~~~~~~~~~ 
In file included from /usr/include/openssl/ct.h:13:0, 
       from /usr/include/openssl/ssl.h:61, 
       from src/event/ngx_event_openssl.h:15, 
       from src/core/ngx_core.h:80, 
       from src/event/ngx_event_openssl.c:9: 
/usr/include/openssl/conf.h:92:1: note: declared here 
DEPRECATEDIN_1_1_0(void OPENSSL_config(const char *config_name)) 
^ 
src/event/ngx_event_openssl.c: In function 'ngx_ssl_rsa512_key_callback': 
src/event/ngx_event_openssl.c:753:9: error: 'RSA_generate_key' is deprecated [-Werror=deprecated-declarations] 
     key = RSA_generate_key(512, RSA_F4, NULL, NULL); 
     ^~~ 
In file included from /usr/include/openssl/rsa.h:13:0, 
       from /usr/include/openssl/x509.h:31, 
       from /usr/include/openssl/ssl.h:50, 
       from src/event/ngx_event_openssl.h:15, 
       from src/core/ngx_core.h:80, 
       from src/event/ngx_event_openssl.c:9: 
/usr/include/openssl/rsa.h:193:1: note: declared here 
DEPRECATEDIN_0_9_8(RSA *RSA_generate_key(int bits, unsigned long e, void 
^ 
src/event/ngx_event_openssl.c: In function 'ngx_ssl_dhparam': 
src/event/ngx_event_openssl.c:943:11: error: dereferencing pointer to incomplete type 'DH {aka struct dh_st}' 
     dh->p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), NULL); 
      ^~ 
src/event/ngx_event_openssl.c: In function 'ngx_ssl_handshake': 
src/event/ngx_event_openssl.c:1164:31: error: dereferencing pointer to incomplete type 'SSL {aka struct ssl_st}' 
     if (c->ssl->connection->s3) { 
           ^~ 
src/event/ngx_event_openssl.c: In function 'ngx_ssl_connection_error': 
src/event/ngx_event_openssl.c:1913:21: error: 'SSL_R_NO_CIPHERS_PASSED' undeclared (first use in this function) 
      || n == SSL_R_NO_CIPHERS_PASSED       /* 182 */ 
        ^~~~~~~~~~~~~~~~~~~~~~~ 
src/event/ngx_event_openssl.c:1913:21: note: each undeclared identifier is reported only once for each function it appears in 
src/event/ngx_event_openssl.c: In function 'ngx_ssl_session_cache': 
src/event/ngx_event_openssl.c:2107:43: error: passing argument 2 of 'SSL_CTX_sess_set_get_cb' from incompatible pointer type [-Werror=incompatible-pointer-types] 
     SSL_CTX_sess_set_get_cb(ssl->ctx, ngx_ssl_get_cached_session); 
              ^~~~~~~~~~~~~~~~~~~~~~~~~~ 
In file included from src/event/ngx_event_openssl.h:15:0, 
       from src/core/ngx_core.h:80, 
       from src/event/ngx_event_openssl.c:9: 
/usr/include/openssl/ssl.h:637:6: note: expected 'SSL_SESSION * (*)(struct ssl_st *, const unsigned char *, int, int *) {aka struct ssl_session_st * (*)(struct ssl_st *, const unsigned char *, int, int *)}' but argument is of type 'SSL_SESSION * (*)(SSL *, u_char *, int, int *) {aka struct ssl_session_st * (*)(struct ssl_st *, unsigned char *, int, int *)}' 
void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx, 
     ^~~~~~~~~~~~~~~~~~~~~~~ 
src/event/ngx_event_openssl.c: In function 'ngx_ssl_session_id_context': 
src/event/ngx_event_openssl.c:2129:27: error: storage size of 'md' isn't known 
    EVP_MD_CTX   md; 
          ^~ 
src/event/ngx_event_openssl.c:2195:5: error: implicit declaration of function 'EVP_MD_CTX_cleanup' [-Werror=implicit-function-declaration] 
    EVP_MD_CTX_cleanup(&md); 
    ^~~~~~~~~~~~~~~~~~ 
src/event/ngx_event_openssl.c: In function 'ngx_ssl_session_ticket_key_callback': 
src/event/ngx_event_openssl.c:2864:9: error: 'RAND_pseudo_bytes' is deprecated [-Werror=deprecated-declarations] 
     RAND_pseudo_bytes(iv, 16); 
     ^~~~~~~~~~~~~~~~~ 
In file included from /usr/include/openssl/engine.h:19:0, 
       from src/event/ngx_event_openssl.h:22, 
       from src/core/ngx_core.h:80, 
       from src/event/ngx_event_openssl.c:9: 
/usr/include/openssl/rand.h:47:1: note: declared here 
DEPRECATEDIN_1_1_0(int RAND_pseudo_bytes(unsigned char *buf, int num)) 
^ 
cc1: all warnings being treated as errors 
make[1]: *** [objs/src/event/ngx_event_openssl.o] Error 1 
objs/Makefile:748: recipe for target 'objs/src/event/ngx_event_openssl.o' failed 
make[1]: Leaving directory '/tmp/nginx/nginx-1.8.0' 
make: *** [install] Error 2 

這是在泊塢窗叉我正在https://github.com/meteorhacks/mup-frontend-server

回答

1

您在這裏獲得各種錯誤和警告,但它們並不是真的關於Docker或OpenSSL。如果我們剝去無關信息,這裏是您遇到的問題。

error: 'OPENSSL_config' is deprecated 
error: 'RSA_generate_key' is deprecated 
error: dereferencing pointer to incomplete type 'DH {aka struct dh_st}' 
error: dereferencing pointer to incomplete type 'SSL {aka struct ssl_st}' 
error: 'SSL_R_NO_CIPHERS_PASSED' undeclared (first use in this function) 
error: passing argument 2 of 'SSL_CTX_sess_set_get_cb' from incompatible pointer type 
error: storage size of 'md' isn't known 
error: implicit declaration of function 'EVP_MD_CTX_cleanup' 
error: 'RAND_pseudo_bytes' is deprecated 

這裏問題的核心可能是你在這個項目中使用的是Nginx的舊版本。從GitHub的庫中,您指出,在install-nginx.sh

NGINX_VERSION=1.8.0 

Nginx的當前主線版本是1.13.2。我沒有梳理Nginx的更新日誌,但根據您收到的錯誤,似乎在1.8版本和當前版本之間,OpenSSL已經棄用了Nginx 1.8依賴的各種功能。很可能這可以通過移植到Nginx的最新版本來解決。

在撰寫本文時,1.13.2是當前的主線,而1.12.0是當前的穩定線。其中一個可能會更好。不管你能否簡單地把它放進去,我都不能說。您可能必須在構建腳本或nginx配置中更改某個更新版本才能正常工作。

+0

感謝您的詳細解答。將研究這一點。 – Allreadyhome

+0

將nginx更改爲版本1.12.0就像一個魅力。 – Allreadyhome

0

由於您的nginx版本不支持SSL 1.1.0,您會收到此錯誤。請升級NGINX版本或使用SSL 1.0.2。