-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from curityio/feat/master/build-module
added build.sh file that creates dynamic modules for 10 platforms.
- Loading branch information
Showing
5 changed files
with
273 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Prerequisites | ||
*.d | ||
|
||
.DS_Store | ||
# Object files | ||
*.o | ||
*.ko | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,185 @@ | ||
###### | ||
FROM ubuntu:18.04 as ubuntu18-builder | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y build-essential libxslt1-dev | ||
|
||
COPY configure /tmp | ||
COPY config /tmp | ||
COPY Makefile /tmp | ||
COPY phantom_token.c /tmp | ||
ARG NGINX_VERSION | ||
ADD nginx-$NGINX_VERSION.tar.gz /tmp/ | ||
|
||
WORKDIR /tmp | ||
RUN ./configure && make | ||
|
||
###### | ||
FROM ubuntu:20.04 as ubuntu20-builder | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y build-essential wget | ||
|
||
COPY configure /tmp | ||
COPY config /tmp | ||
COPY Makefile /tmp | ||
COPY phantom_token.c /tmp | ||
ARG NGINX_VERSION | ||
ADD nginx-$NGINX_VERSION.tar.gz /tmp/ | ||
|
||
WORKDIR /tmp | ||
RUN wget https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz && tar xzvf pcre-8.44.tar.gz | ||
RUN wget https://www.zlib.net/zlib-1.2.11.tar.gz && tar xzvf zlib-1.2.11.tar.gz | ||
RUN CONFIG_OPTS="--with-pcre=../pcre-8.44 --with-zlib=../zlib-1.2.11" ./configure && make | ||
|
||
###### | ||
FROM centos:6 as centos6-builder | ||
|
||
RUN yum install -y \ | ||
gcc pcre-devel zlib-devel | ||
|
||
COPY configure /tmp | ||
COPY config /tmp | ||
COPY Makefile /tmp | ||
COPY phantom_token.c /tmp | ||
ARG NGINX_VERSION | ||
ADD nginx-$NGINX_VERSION.tar.gz /tmp/ | ||
|
||
WORKDIR /tmp | ||
RUN ./configure && make | ||
|
||
###### | ||
FROM centos:7 as centos7-builder | ||
|
||
RUN yum install -y \ | ||
gcc pcre-devel zlib-devel make | ||
|
||
COPY configure /tmp | ||
COPY config /tmp | ||
COPY Makefile /tmp | ||
COPY phantom_token.c /tmp | ||
ARG NGINX_VERSION | ||
ADD nginx-$NGINX_VERSION.tar.gz /tmp/ | ||
|
||
WORKDIR /tmp | ||
RUN ./configure && make | ||
|
||
###### | ||
FROM centos:8 as centos8-builder | ||
|
||
RUN yum install -y \ | ||
gcc pcre-devel zlib-devel make | ||
|
||
COPY configure /tmp | ||
COPY config /tmp | ||
COPY Makefile /tmp | ||
COPY phantom_token.c /tmp | ||
ARG NGINX_VERSION | ||
ADD nginx-$NGINX_VERSION.tar.gz /tmp/ | ||
|
||
WORKDIR /tmp | ||
RUN ./configure && make | ||
|
||
###### | ||
FROM debian:stretch as debian9-builder | ||
|
||
RUN apt update && apt install -y \ | ||
wget build-essential git tree software-properties-common dirmngr apt-transport-https ufw | ||
|
||
COPY configure /tmp | ||
COPY config /tmp | ||
COPY Makefile /tmp | ||
COPY phantom_token.c /tmp | ||
ARG NGINX_VERSION | ||
ADD nginx-$NGINX_VERSION.tar.gz /tmp/ | ||
|
||
WORKDIR /tmp | ||
RUN wget https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz && tar xzvf pcre-8.44.tar.gz | ||
RUN wget https://www.zlib.net/zlib-1.2.11.tar.gz && tar xzvf zlib-1.2.11.tar.gz | ||
RUN CONFIG_OPTS="--with-pcre=../pcre-8.44 --with-zlib=../zlib-1.2.11" ./configure && make | ||
|
||
###### | ||
FROM debian:buster as debian10-builder | ||
|
||
RUN apt update && apt install -y \ | ||
wget build-essential git tree software-properties-common dirmngr apt-transport-https ufw | ||
|
||
COPY configure /tmp | ||
COPY config /tmp | ||
COPY Makefile /tmp | ||
COPY phantom_token.c /tmp | ||
ARG NGINX_VERSION | ||
ADD nginx-$NGINX_VERSION.tar.gz /tmp/ | ||
|
||
WORKDIR /tmp | ||
RUN wget https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz && tar xzvf pcre-8.44.tar.gz | ||
RUN wget https://www.zlib.net/zlib-1.2.11.tar.gz && tar xzvf zlib-1.2.11.tar.gz | ||
RUN CONFIG_OPTS="--with-pcre=../pcre-8.44 --with-zlib=../zlib-1.2.11" ./configure && make | ||
|
||
###### | ||
FROM amazonlinux:1 as amzn-builder | ||
|
||
RUN yum install -y \ | ||
gcc pcre-devel zlib-devel make | ||
|
||
COPY configure /tmp | ||
COPY config /tmp | ||
COPY Makefile /tmp | ||
COPY phantom_token.c /tmp | ||
ARG NGINX_VERSION | ||
ADD nginx-$NGINX_VERSION.tar.gz /tmp/ | ||
|
||
WORKDIR /tmp | ||
RUN ./configure && make | ||
|
||
###### | ||
FROM amazonlinux:2 as amzn2-builder | ||
|
||
RUN yum install -y \ | ||
gcc pcre-devel zlib-devel make | ||
|
||
COPY configure /tmp | ||
COPY config /tmp | ||
COPY Makefile /tmp | ||
COPY phantom_token.c /tmp | ||
ARG NGINX_VERSION | ||
ADD nginx-$NGINX_VERSION.tar.gz /tmp/ | ||
|
||
WORKDIR /tmp | ||
RUN ./configure && make | ||
|
||
###### | ||
FROM alpine as alpine-builder | ||
|
||
RUN apk add --no-cache --virtual .build-deps \ | ||
gcc libc-dev make openssl-dev pcre-dev zlib-dev linux-headers libxslt-dev \ | ||
gd-dev geoip-dev perl-dev libedit-dev mercurial bash alpine-sdk findutils bash | ||
|
||
COPY configure /tmp | ||
COPY config /tmp | ||
COPY Makefile /tmp | ||
COPY phantom_token.c /tmp | ||
ARG NGINX_VERSION | ||
ADD nginx-$NGINX_VERSION.tar.gz /tmp/ | ||
|
||
WORKDIR /tmp | ||
RUN ./configure && make | ||
|
||
###### | ||
FROM alpine | ||
|
||
ARG NGINX_VERSION | ||
COPY --from=ubuntu18-builder /tmp/nginx-$NGINX_VERSION/objs/ngx_curity_http_phantom_token_module.so /build/ubuntu.18.04.ngx_curity_http_phantom_token_module_$NGINX_VERSION.so | ||
COPY --from=ubuntu20-builder /tmp/nginx-$NGINX_VERSION/objs/ngx_curity_http_phantom_token_module.so /build/ubuntu.20.04.ngx_curity_http_phantom_token_module_$NGINX_VERSION.so | ||
COPY --from=centos6-builder /tmp/nginx-$NGINX_VERSION/objs/ngx_curity_http_phantom_token_module.so /build/centos.6.ngx_curity_http_phantom_token_module_$NGINX_VERSION.so | ||
COPY --from=centos7-builder /tmp/nginx-$NGINX_VERSION/objs/ngx_curity_http_phantom_token_module.so /build/centos.7.ngx_curity_http_phantom_token_module_$NGINX_VERSION.so | ||
COPY --from=centos8-builder /tmp/nginx-$NGINX_VERSION/objs/ngx_curity_http_phantom_token_module.so /build/centos.8.ngx_curity_http_phantom_token_module_$NGINX_VERSION.so | ||
COPY --from=debian9-builder /tmp/nginx-$NGINX_VERSION/objs/ngx_curity_http_phantom_token_module.so /build/debian.stretch.ngx_curity_http_phantom_token_module_$NGINX_VERSION.so | ||
COPY --from=debian10-builder /tmp/nginx-$NGINX_VERSION/objs/ngx_curity_http_phantom_token_module.so /build/debian.buster.ngx_curity_http_phantom_token_module_$NGINX_VERSION.so | ||
COPY --from=amzn-builder /tmp/nginx-$NGINX_VERSION/objs/ngx_curity_http_phantom_token_module.so /build/amzn.ngx_curity_http_phantom_token_module_$NGINX_VERSION.so | ||
COPY --from=amzn2-builder /tmp/nginx-$NGINX_VERSION/objs/ngx_curity_http_phantom_token_module.so /build/amzn2.ngx_curity_http_phantom_token_module_$NGINX_VERSION.so | ||
COPY --from=alpine-builder /tmp/nginx-$NGINX_VERSION/objs/ngx_curity_http_phantom_token_module.so /build/alpine.ngx_curity_http_phantom_token_module_$NGINX_VERSION.so | ||
|
||
ENTRYPOINT ["sleep"] | ||
|
||
CMD ["300"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.