1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
|
FROM alpine:3.20 AS lua_build
RUN apk update && \
apk add \
luajit-dev \
luarocks5.1 \
gcc \
musl-dev \
openssl-dev \
hiredis-dev \
openldap-dev
RUN luarocks-5.1 config variables.LUA_INCDIR /usr/include/luajit-2.1
RUN luarocks-5.1 install elasticsearch-lua && \
luarocks-5.1 install lua-cjson && \
luarocks-5.1 install lualdap && \
luarocks-5.1 install luasocket && \
luarocks-5.1 install luasec && \
luarocks-5.1 install lua-resty-template && \
luarocks-5.1 install redis-lua
FROM alpine:3.20 AS wforce_build
RUN apk update && \
apk add \
asciidoctor \
autoconf \
automake \
boost-dev \
curl-dev \
openssl-dev \
hiredis-dev \
readline-dev \
libmaxminddb-dev \
luajit-dev \
protobuf-dev \
yaml-cpp-dev \
jsoncpp-dev \
zlib-dev \
libtool \
pkgconf \
protobuf \
wget \
util-linux-dev \
make \
cmake \
git \
binutils \
g++
WORKDIR /wforce/
RUN mkdir /wforce/install
RUN git clone https://github.com/drogonframework/drogon.git
RUN cd drogon && git checkout tags/v1.9.1 -b v1.9.1
RUN cd drogon && git submodule init && git submodule update && mkdir _build && cd _build && cmake .. -DBUILD_BROTLI=OFF -DBUILD_C-ARES=OFF -DBUILD_REDIS=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_ORM=OFF && make && make install
RUN git clone https://github.com/jupp0r/prometheus-cpp.git
RUN cd prometheus-cpp && git checkout tags/v1.0.1 -b v1.0.1
RUN cd prometheus-cpp && \
mkdir _build && cd _build && cmake .. -DBUILD_SHARED_LIBS=off -DENABLE_PULL=off \
-DENABLE_PUSH=off -DENABLE_COMPRESSION=off -DENABLE_TESTING=off \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON && make && make install
RUN wget https://getdnsapi.net/dist/getdns-1.7.3.tar.gz && tar -xvf getdns-1.7.3.tar.gz
RUN cd getdns-1.7.3 && cmake . -DCMAKE_BUILD_TYPE=Release -DENABLE_SHARED=off -DENABLE_STUB_ONLY=on -DBUILD_GETDNS_QUERY=off -DBUILD_GETDNS_SERVER_MON=off -DBUILD_TESTING:BOOL=OFF -DUSE_LIBIDN2=off && make install
ADD CHANGELOG.md configure.ac ext LICENSE Makefile.am README.md NOTICE /wforce/
COPY m4/ /wforce/m4/
COPY ext/ /wforce/ext/
COPY docs/ /wforce/docs/
COPY wforce/ /wforce/wforce/
COPY common/ /wforce/common/
COPY trackalert/ /wforce/trackalert/
COPY docker/Makefile.am /wforce/docker/
RUN mkdir /wforce/docker/wforce_image
COPY docker/wforce_image/Makefile.am /wforce/docker/wforce_image
COPY elk/ /wforce/elk/
COPY grafana/ /wforce/grafana/
RUN autoreconf -ivf
RUN ./configure --prefix /usr --enable-trackalert --disable-systemd --disable-sodium --disable-docker --with-luajit --sysconfdir=/etc/wforce
RUN make clean
RUN make install DESTDIR=/wforce/install
RUN strip /wforce/install/usr/bin/wforce /wforce/install/usr/bin/trackalert
# Remove the default wforce.conf and trackalert.conf files
RUN rm /wforce/install/etc/wforce/wforce.conf /wforce/install/etc/wforce/trackalert.conf
FROM alpine:3.20 AS wforce_image
WORKDIR /wforce/
COPY --from=wforce_build /wforce/install/ /
COPY --from=lua_build /usr/local/share/lua /usr/local/share/lua
COPY --from=lua_build /usr/local/lib/lua /usr/local/lib/lua
RUN apk update && \
apk add \
boost-filesystem \
curl \
openssl \
libldap \
hiredis \
readline \
libmaxminddb \
luajit \
libprotobuf \
yaml-cpp \
jsoncpp \
zlib \
protobuf \
abseil-cpp \
abseil-cpp-flags-marshalling \
util-linux \
tzdata \
tini
RUN addgroup --gid 1000 wforce && \
adduser -u 1000 -S -G wforce wforce && \
chmod -R 0775 /etc/wforce && \
chgrp -R 1000 /etc/wforce
ARG license
ARG git_revision
ARG version
LABEL org.label-schema.license="${license}" \
org.label-schema.name="Weakforced" \
org.label-schema.schema-version="1.0" \
org.label-schema.url="https://powerdns.github.io/weakforced" \
org.label-schema.usage="https://powerdns.github.io/weakforced" \
org.label-schema.vcs-ref="${git_revision}" \
org.label-schema.vcs-url="https://github.com/PowerDNS/weakforced" \
org.label-schema.vendor="PowerDNS" \
org.label-schema.version="${version}" \
org.opencontainers.image.documentation="https://powerdns.github.io/weakforced" \
org.opencontainers.image.licenses="${license}" \
org.opencontainers.image.revision="${git_revision}" \
org.opencontainers.image.source="https://github.com/PowerDNS/weakforced" \
org.opencontainers.image.title="Weakforced" \
org.opencontainers.image.url="https://powerdns.github.io/weakforced" \
org.opencontainers.image.vendor="PowerDNS" \
org.opencontainers.image.version="${version}"
USER wforce:wforce
EXPOSE 8084
ENTRYPOINT ["tini", "--"]
CMD ["/usr/bin/wforce", "-D"]
|