Skip to content

Commit db913a9

Browse files
committed
apply patches
1 parent 712ab5b commit db913a9

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

Dockerfile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
FROM debian:11-slim as build
22

3-
ENV PACKAGES="python3 python3-pip nmap"
3+
ENV PACKAGES="python3 python3-pip nmap patch"
4+
ENV PACKAGES_CLEAN="patch"
45

56
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
67

@@ -22,14 +23,21 @@ ADD $GIT_ARCHIVE /
2223
RUN tar --strip-component 1 -xzvf /$GIT_COMMIT.tar.gz && rm /$GIT_COMMIT.tar.gz \
2324
&& mkdir logs
2425

26+
# Copy root filesystem
27+
COPY rootfs /
28+
29+
# DNS patch
30+
RUN patch -i /patches/__init__.py.patch /netbox-scanner/nbs/__init__.py
31+
RUN patch -i /patches/nmap.py.patch /netbox-scanner/nbs/nmap.py
32+
2533
# Install dependencies
2634
RUN pip3 install --no-cache-dir -r requirements.txt
2735

2836
# Cleanup
2937
RUN find /usr/ -name '*.pyc' -delete
30-
31-
# Copy root filesystem
32-
COPY rootfs /
38+
RUN rm -rf /patches
39+
RUN apt-get -y purge $PACKAGES_CLEAN \
40+
&& apt-get -y autoremove
3341

3442
# Build final image
3543
FROM scratch

0 commit comments

Comments
 (0)