Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔧 improved version of your Dockerfile #1420

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 38 additions & 54 deletions web/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,64 +1,50 @@
# Base image
FROM ubuntu:22.04

# Args and Environment Variables
ARG GECKOVERSION=0.33.0
ARG GOVERSION=1.21.5

RUN ARCH=$(dpkg --print-architecture) \
&& if [ "${ARCH}" ! "arm64" ] || [ "${ARCH}" ! "amd64" ]; then \
echo "reNgine not supported, encountered unknown architecture: ${TARGETPLATFORM}" \
&& exit 1; \
fi

# Labels and Credits
LABEL \
name="reNgine" \
author="Yogesh Ojha <yogesh.ojha11@gmail.com>" \
description="reNgine is a automated pipeline of recon process, useful for information gathering during web application penetration testing."

# Environment Variables
ENV DEBIAN_FRONTEND="noninteractive" \
DATABASE="postgres"
ENV DEBIAN_FRONTEND="noninteractive"
ENV DATABASE="postgres"
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV GOROOT="/usr/local/go"
ENV GOPATH=$HOME/go
ENV PATH="${PATH}:${GOROOT}/bin:${GOPATH}/bin"

# Install Python
RUN apt update -y && \
apt install -y \
python3.10 \
python3-dev \
python3-pip

# Install essential packages
RUN apt install -y --no-install-recommends \
build-essential \
cmake \
geoip-bin \
geoip-database \
gcc \
git \
libpq-dev \
libpango-1.0-0 \
libpangoft2-1.0-0 \
libpcap-dev \
netcat \
nmap \
x11-utils \
xvfb \
wget \
curl \
python3-netaddr \
software-properties-common

RUN add-apt-repository ppa:mozillateam/ppa

RUN ARCH=$(dpkg --print-architecture) \
&& curl -L https://go.dev/dl/go${GOVERSION}.linux-${ARCH}.tar.gz | tar -xzC /usr/local
# Labels and Credits
LABEL \
name="reNgine" \
author="Yogesh Ojha <yogesh.ojha11@gmail.com>" \
description="reNgine is a automated pipeline of recon process, useful for information gathering during web application penetration testing."

RUN ARCH=$(dpkg --print-architecture) \
# Supported architectures
ARG SUPPORTED_ARCH="amd64 arm64 armv6 armv7 armhf i386 x86_64"

# Install essential required packages
RUN ARCH=$(dpkg --print-architecture) \
&& echo "$SUPPORTED_ARCH" | grep -qw "$ARCH" || { \
echo "Unsupported architecture: $ARCH"; exit 1; \
} \
&& apt update -y \
&& apt install -y --no-install-recommends \
python3.10 python3-dev python3-pip \
build-essential cmake geoip-bin geoip-database \
gcc git libpq-dev libpango-1.0-0 libpangoft2-1.0-0 \
libpcap-dev netcat nmap x11-utils xvfb wget curl \
python3-netaddr software-properties-common \
gpg-agent \
&& add-apt-repository -y ppa:mozillateam/ppa \
&& apt update -y

# Install Go
RUN ARCH=$(dpkg --print-architecture) \
&& curl -s -L -o /tmp/go.tar.gz https://go.dev/dl/go${GOVERSION}.linux-${ARCH}.tar.gz \
&& tar -xzC /usr/local -f /tmp/go.tar.gz \
&& rm /tmp/go.tar.gz

# Install Gecko Driver
RUN ARCH=$(dpkg --print-architecture) \
&& if [ "${ARCH}" = "arm64" ]; then \
GECKOPATH="geckodriver-v${GECKOVERSION}-linux-aarch64.tar.gz"; \
elif [ "${ARCH}" = "amd64" ]; then \
Expand All @@ -69,15 +55,14 @@ RUN ARCH=$(dpkg --print-architecture) \
&& rm ${GECKOPATH} \
&& mv geckodriver /usr/bin

# Install Rust for orjson
# Install Rust
RUN set -e; curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN pip3 install maturin

# Make directory for app
# Install Go packages
WORKDIR /usr/src/app

ENV GO111MODULE=on
ENV GO111MODULE=on
RUN printf "\
github.com/jaeles-project/gospider@latest\n\
github.com/tomnomnom/gf@latest\n\
Expand All @@ -99,7 +84,6 @@ RUN printf "\
xargs -L1 go install -ldflags="-s -w" -v && \
rm -rf /go/pkg/* && rm -rf /root/.cache/go-build


# Update Nuclei and Nuclei-Templates
RUN nuclei -update-templates

Expand Down
Loading