Simplified Dockerfile

This commit is contained in:
DomySh
2022-08-02 14:36:34 +00:00
parent 02ae916f58
commit 47b75d3efe

View File

@@ -2,7 +2,7 @@
FROM python:alpine
RUN apk update
RUN apk add g++ git pcre2-dev libnetfilter_queue-dev libpcap-dev libcrypto1.1 libnfnetlink-dev libmnl-dev make cmake nftables boost-dev libcap shadow bash
RUN apk add g++ git pcre2-dev libnetfilter_queue-dev libpcap-dev libcrypto1.1 libnfnetlink-dev libmnl-dev make cmake nftables boost-dev libcap bash
WORKDIR /tmp/
RUN git clone --single-branch --branch release https://github.com/jpcre2/jpcre2
@@ -13,21 +13,12 @@ WORKDIR /tmp/libtins
RUN mkdir build; cd build; cmake ../ -DLIBTINS_ENABLE_CXX11=1; make; make install
RUN mkdir -p /execute/modules
WORKDIR /execute
ADD ./backend/requirements.txt /execute/requirements.txt
RUN pip3 install --no-cache-dir -r /execute/requirements.txt --no-warn-script-location
RUN chown nobody:nobody -R /execute/
RUN usermod -d /tmp/nobody nobody && usermod --shell /bin/sh nobody
USER nobody
RUN mkdir /tmp/nobody
COPY ./backend/binsrc /execute/binsrc
ARG GCC_PARAMS
RUN g++ binsrc/nfqueue.cpp -o modules/cppqueue -O3 -march=native -lnetfilter_queue -pthread -lpcre2-8 -ltins -lmnl -lnfnetlink
RUN g++ binsrc/proxy.cpp -o modules/proxy -O3 -march=native $GCC_PARAMS -pthread -lboost_system -lboost_thread -lpcre2-8
@@ -36,7 +27,6 @@ RUN g++ binsrc/proxy.cpp -o modules/proxy -O3 -march=native $GCC_PARAMS -pthread
COPY ./backend/ /execute/
COPY ./frontend/build/ ./frontend/
USER root
ENTRYPOINT ["/bin/sh", "/execute/docker-entrypoint.sh"]