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

Dockerfile Build Multiple Platforms #1210

Merged
merged 2 commits into from
Jun 22, 2024
Merged
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
102 changes: 71 additions & 31 deletions web/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Base image
FROM --platform=linux/amd64 ubuntu:22.04
FROM ubuntu:22.04

ARG version=0.33.0
ARG geckodriver_amd=geckodriver-v${version}-linux64.tar.gz
ARG geckodriver_arm=geckodriver-v${version}-linux-aarch64.tar.gz

ARG go_version=1.21.5
ARG go_amd=go${go_version}.linux-amd64.tar.gz
ARG go_arm=go${go_version}.linux-arm64.tar.gz


# Labels and Credits
LABEL \
Expand All @@ -18,11 +27,10 @@ ENV PATH="${PATH}:${GOROOT}/bin:${GOPATH}/bin"

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

# Install essential packages
RUN apt install -y --no-install-recommends \
Expand All @@ -47,17 +55,40 @@ RUN apt install -y --no-install-recommends \

RUN add-apt-repository ppa:mozillateam/ppa

# Download and install go 1.20
RUN wget https://golang.org/dl/go1.21.4.linux-amd64.tar.gz
RUN tar -xvf go1.21.4.linux-amd64.tar.gz
RUN rm go1.21.4.linux-amd64.tar.gz
RUN mv go /usr/local
RUN ARCH=$(dpkg --print-architecture) \
&& if [ "${ARCH}" = "arm64" ]; then \
wget https://go.dev/dl/${go_arm} \
&& tar -xvf ${go_arm} \
&& rm ${go_arm} \
&& mv go /usr/local; \
elif [ "${ARCH}" = "amd64" ]; then \
wget https://go.dev/dl/${go_amd} \
&& tar -xvf ${go_amd} \
&& rm ${go_amd} \
&& mv go /usr/local; \
else \
echo "Unknown architecture: $ARCH" ; \
exit 1; \
fi



RUN ARCH=$(dpkg --print-architecture) \
&& if [ "${ARCH}" = "arm64" ]; then \
wget https://github.com/mozilla/geckodriver/releases/download/v${version}/${geckodriver_arm} \
&& tar -xvf ${geckodriver_arm} \
&& rm ${geckodriver_arm} \
&& mv geckodriver /usr/bin; \
elif [ "${ARCH}" = "amd64" ]; then \
wget https://github.com/mozilla/geckodriver/releases/download/v${version}/${geckodriver_amd} \
&& tar -xvf ${geckodriver_amd} \
&& rm ${geckodriver_amd} \
&& mv geckodriver /usr/bin; \
else \
echo "Unknown architecture: $ARCH" ; \
exit 1; \
fi

# Download geckodriver
RUN wget https://github.com/mozilla/geckodriver/releases/download/v0.32.0/geckodriver-v0.32.0-linux64.tar.gz
RUN tar -xvf geckodriver-v0.32.0-linux64.tar.gz
RUN rm geckodriver-v0.32.0-linux64.tar.gz
RUN mv geckodriver /usr/bin

# Make directory for app
WORKDIR /usr/src/app
Expand All @@ -67,24 +98,33 @@ ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# Download Go packages
RUN go install -v github.com/jaeles-project/gospider@latest
RUN go install -v github.com/tomnomnom/gf@latest
RUN go install -v github.com/tomnomnom/unfurl@latest
RUN go install -v github.com/tomnomnom/waybackurls@latest
RUN go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest
RUN go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest
RUN go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest
RUN go install -v github.com/projectdiscovery/naabu/v2/cmd/naabu@latest
RUN go install -v github.com/hakluke/hakrawler@latest
RUN go install -v github.com/lc/gau/v2/cmd/gau@latest
RUN go install -v github.com/jaeles-project/gospider@latest
RUN go install -v github.com/owasp-amass/amass/v3/...@latest
RUN go install -v github.com/ffuf/ffuf@latest
RUN go install -v github.com/projectdiscovery/tlsx/cmd/tlsx@latest
RUN go install -v github.com/hahwul/dalfox/v2@latest
RUN go install -v github.com/projectdiscovery/katana/cmd/katana@latest
RUN go install -v github.com/dwisiswant0/crlfuzz/cmd/crlfuzz@latest
RUN go install -v github.com/sa7mon/s3scanner@latest



RUN ARCH=$(dpkg --print-architecture) \
&& if [[ "$ARCH" = "arm64" || "$ARCH" = "amd64" ]]; then
GOARCH=$ARCH go install -v github.com/jaeles-project/gospider@latest \
&& GOARCH=$ARCH go install -v github.com/tomnomnom/gf@latest \
&& GOARCH=$ARCH go install -v github.com/tomnomnom/unfurl@latest \
&& GOARCH=$ARCH go install -v github.com/tomnomnom/waybackurls@latest \
&& GOARCH=$ARCH go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest \
&& GOARCH=$ARCH go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest \
&& GOARCH=$ARCH go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest \
&& GOARCH=$ARCH go install -v github.com/projectdiscovery/naabu/v2/cmd/naabu@latest \
&& GOARCH=$ARCH go install -v github.com/lc/gau/v2/cmd/gau@latest \
&& GOARCH=$ARCH go install -v github.com/jaeles-project/gospider@latest \
&& GOARCH=$ARCH go install -v github.com/owasp-amass/amass/v3/...@latest \
&& GOARCH=$ARCH go install -v github.com/ffuf/ffuf@latest \
&& GOARCH=$ARCH go install -v github.com/projectdiscovery/tlsx/cmd/tlsx@latest \
&& GOARCH=$ARCH go install -v github.com/hahwul/dalfox/v2@latest \
&& GOARCH=$ARCH go install -v github.com/projectdiscovery/katana/cmd/katana@latest \
&& GOARCH=$ARCH go install -v github.com/dwisiswant0/crlfuzz/cmd/crlfuzz@latest \
&& GOARCH=$ARCH go install -v github.com/sa7mon/s3scanner@latest; \
else \
echo "Unknown architecture: $ARCH" ; \
exit 1; \
fi


# Update Nuclei and Nuclei-Templates
RUN nuclei -update
Expand Down
Loading