File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 1
1
FROM debian:11-slim as build
2
2
3
- ENV PACKAGES="python3 python3-pip nmap"
3
+ ENV PACKAGES="python3 python3-pip nmap patch"
4
+ ENV PACKAGES_CLEAN="patch"
4
5
5
6
SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
6
7
@@ -22,14 +23,21 @@ ADD $GIT_ARCHIVE /
22
23
RUN tar --strip-component 1 -xzvf /$GIT_COMMIT.tar.gz && rm /$GIT_COMMIT.tar.gz \
23
24
&& mkdir logs
24
25
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
+
25
33
# Install dependencies
26
34
RUN pip3 install --no-cache-dir -r requirements.txt
27
35
28
36
# Cleanup
29
37
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
33
41
34
42
# Build final image
35
43
FROM scratch
You can’t perform that action at this time.
0 commit comments