-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathDockerfile
51 lines (36 loc) · 1.41 KB
/
Dockerfile
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
# Compile hcxtools
FROM ubuntu:22.04 as hcxtools-builder
WORKDIR /app
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install python3-pip make git zlib1g-dev -y \
&& apt-get install pkg-config libcurl4-openssl-dev libssl-dev zlib1g-dev make gcc -y \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Clone hcxtools and install
RUN git clone -b 6.3.1 https://github.com/ZerBea/hcxtools.git /app/hcxtools \
&& cd /app/hcxtools \
&& make \
&& make install \
&& cd /app \
&& rm -rf /app/hcxtools
FROM ubuntu:22.04
WORKDIR /app
# Install dependencies
ENV DEBIAN_FRONTEND noninteractive
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get update && apt-get install -y --no-install-recommends python3-pip tshark git libcurl4-openssl-dev libssl-dev -y \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Copy hcxtools binaries
COPY --from=hcxtools-builder /usr/bin/hcx* /usr/bin/
# Copy and install Python dependencies
RUN python3 -m pip install --no-cache-dir -U pip \
&& python3 -m pip install --no-cache-dir pytest
COPY requirements.txt requirements.txt
RUN pip3 install --no-cache-dir -r requirements.txt
# Copy your application code
COPY . .
# Run tests and remove test data
RUN python3 -m pytest \
&& rm -rf test_data
# Create a captures directory
RUN mkdir /captures/
# Set the entry point
ENTRYPOINT ["python3", "/app/wifi_db.py", "/captures/", "-d", "/db.SQLITE"]