pires / netty-tcnative-alpine Goto Github PK
View Code? Open in Web Editor NEWBuild netty-tcnative native binaries for Alpine Linux.
License: Apache License 2.0
Build netty-tcnative native binaries for Alpine Linux.
License: Apache License 2.0
I don't really understand why, but running
docker run -v `pwd`/binaries pires/netty-tcnative-alpine
left that directory empty after the container was run.
Im running ubuntu 16.04 with docker 1.11.1
What worked for me was
docker run -v `pwd`/binaries:/output pires/netty-tcnative-alpine
The openssl-static
tests fail because the maven build happening in the container is unable to download apr-1.5.2.tar.gz
from http://www.us.apache.org/dist/apr (and it truly is no longer there).
So it looks like the netty-tcnative
version specified in Dockerfile
needs to be updated to a version of netty-tcnative
that uses apr-1.6.2
in its build.
Looks like upstream alpine was changed from 3.7 to 3.8 and this causes the build to fail. Workaround is to downgrade to 8u171 as the builder base image which is based on Alpine 3.7.
[INFO] checking if '/opt/jdk' is a JDK... yes
[INFO] checking for APR... yes
[INFO] checking for OpenSSL library... using openssl from /usr/lib and /usr/include
[INFO] checking OpenSSL library version... not compatible
[INFO] checking for OpenSSL DSA support... yes
[INFO] setting TCNATIVE_PRIV_INCLUDES to ""
[INFO] setting TCNATIVE_LDFLAGS to "-lssl -lcrypto"
[INFO] adding "-DHAVE_OPENSSL" to CFLAGS
[INFO] checking whether build environment is sane... yes
[INFO] checking for a thread-safe mkdir -p... autotools/install-sh -c -d
[INFO] checking whether make sets $(MAKE)... yes
[INFO] checking whether make supports nested variables... yes
[INFO] checking that generated files are newer than configure... done
[INFO] configure: creating ./config.status
[INFO] configure: WARNING: unrecognized options: --disable-ccache
[INFO]
[INFO] (@PROJECT_NAME@) version @VERSION@
[INFO] Prefix.........: /netty-tcnative/openssl-dynamic/target/native-build/target
[INFO] C Compiler.....: gcc -O3 -Werror -fno-omit-frame-pointer -Wunused-variable -DHAVE_OPENSSL -I/usr/include/apr-1 -D_LARGEFILE64_SOURCE -I/opt/jdk/include -I/opt/jdk/include/linux
[INFO] Linker.........: /usr/x86_64-alpine-linux-musl/bin/ld -m elf_x86_64 -lssl -lcrypto -L/usr/lib -R/usr/lib -lapr-1 -luuid -lpthread -release @VERSION@
[INFO]
[INFO] /bin/bash ./config.status
[INFO] config.status: creating Makefile
[INFO] config.status: creating src/config.h
[INFO] config.status: src/config.h is unchanged
[INFO] config.status: executing libtool commands
[INFO] /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I./src -O3 -Werror -fno-omit-frame-pointer -Wunused-variable -DHAVE_OPENSSL -I/usr/include/apr-1 -D_LARGEFILE64_SOURCE -I/opt/jdk/include -I/opt/jdk/include/linux -c -o src/jnilib.lo src/jnilib.c
[INFO] libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./src -O3 -Werror -fno-omit-frame-pointer -Wunused-variable -DHAVE_OPENSSL -I/usr/include/apr-1 -D_LARGEFILE64_SOURCE -I/opt/jdk/include -I/opt/jdk/include/linux -c src/jnilib.c -fPIC -DPIC -o src/.libs/jnilib.o
[INFO] /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I./src -O3 -Werror -fno-omit-frame-pointer -Wunused-variable -DHAVE_OPENSSL -I/usr/include/apr-1 -D_LARGEFILE64_SOURCE -I/opt/jdk/include -I/opt/jdk/include/linux -c -o src/native_constants.lo src/native_constants.c
[INFO] libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./src -O3 -Werror -fno-omit-frame-pointer -Wunused-variable -DHAVE_OPENSSL -I/usr/include/apr-1 -D_LARGEFILE64_SOURCE -I/opt/jdk/include -I/opt/jdk/include/linux -c src/native_constants.c -fPIC -DPIC -o src/.libs/native_constants.o
[INFO] In file included from src/native_constants.c:18:0:
[INFO] src/ssl_private.h:138:0: error: "OPENSSL_VERSION" redefined [-Werror]
[INFO] #define OPENSSL_VERSION SSLEAY_VERSION
[INFO]
[INFO] In file included from /usr/include/openssl/bio.h:69:0,
[INFO] from /usr/include/openssl/evp.h:67,
[INFO] from /usr/include/openssl/hmac.h:67,
[INFO] from /usr/include/openssl/ssl.h:149,
[INFO] from src/ssl_private.h:57,
[INFO] from src/native_constants.c:18:
[INFO] /usr/include/openssl/crypto.h:334:0: note: this is the location of the previous definition
[INFO] #define OPENSSL_VERSION 0
[INFO]
[INFO] cc1: all warnings being treated as errors
[INFO] make: *** [Makefile:508: src/native_constants.lo] Error 1
[INFO] rc: 2
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Netty/TomcatNative [Parent] ........................ SUCCESS [ 30.857 s]
[INFO] Netty/TomcatNative [OpenSSL - Dynamic] ............. FAILURE [ 24.860 s]
[INFO] Netty/TomcatNative [OpenSSL - Static] .............. SKIPPED
[INFO] Netty/TomcatNative [BoringSSL - Static] ............ SKIPPED
[INFO] Netty/TomcatNative [LibreSSL - Static] ............. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
This is just FYI, but I did some recent testing on Alpine and I discovered that netty-tcnative-boringssl-static works without issue on standard Alpine.
For openjdk:8-jre-alpine
, I ran apk update && apk add libc6-compat
while generating the docker image.
For alpine:latest
, I ran apk update && apk add openjdk8-jre-base libc6-compat
.
adoptopenjdk/openjdk8:alpine-slim
and adoptopenjdk/openjdk11:alpine-slim
worked out-of-the-box.
[exec] make[1]: Leaving directory '/netty-tcnative/libressl-static/target/libressl-2.4.5/crypto'
[exec] compat/getentropy_linux.c:31:26: fatal error: linux/sysctl.h: No such file or directory
[exec] #include <linux/sysctl.h>
[exec] ^
[exec] compilation terminated.
[exec] make[1]: *** [Makefile:3615: compat/getentropy_linux.lo] Error 1
[exec] make: *** [Makefile:451: all-recursive] Error 1
Maven build failed on both Final 2.0.0 or master.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project netty-tcnative: Compilation failure -> [Help 1]
Is it because jdk version changed?
Openssl 1.0.2h is downloaded to openssl-static/target/old/1.0.2/ directory, but the ant build file looks for the file under openssl-static/target/. Because of this, building the openssl-static module fails. The easy fix would be to upgrade openssl to 1.0.2k. A better solution would be to make sure that the file is downloaded to the right location.
Thanks for your work! Now that these files can be easily generated, it would be nice to also upload those built binaries .travis.yml
that does a docker build and maven publish. What do you think?
The file openssl-1.0.2l.tar.gz
cannot be found:
main:
[ftp] getting files
[ftp] transferring old/1.0.2/openssl-1.0.2l.tar.gz to /netty-tcnative/openssl-static/target/old/1.0.2/openssl-1.0.2l.tar.gz
[ftp] 1 files retrieved
[exec] tar: can't open 'openssl-1.0.2l.tar.gz': No such file or directory
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Netty/TomcatNative [Parent] ........................ SUCCESS [ 37.537 s]
[INFO] Netty/TomcatNative [OpenSSL - Dynamic] ............. SUCCESS [ 24.060 s]
[INFO] Netty/TomcatNative [OpenSSL - Static] .............. FAILURE [ 46.304 s]
[INFO] Netty/TomcatNative [BoringSSL - Static] ............ SKIPPED
[INFO] Netty/TomcatNative [LibreSSL - Static] ............. SKIPPED
OpenSSL has arrived at 1.0.2.m
, for which there is no tag in netty-tcnative
yet. However, checking out the master works:
$ docker build --build-arg NETTY_TCNATIVE_TAG=master -t pires/netty-tcnative-alpine:master .
$ mkdir binaries
$ docker run -v `pwd`/binaries:/output pires/netty-tcnative-alpine:master
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.