Skip to content

Commit bb15bc9

Browse files
committed
version 1.0
1 parent 343f906 commit bb15bc9

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ ENV VERSION="0.1.1"
66

77
ENV PACKAGES="python3 python3-pip nmap"
88

9+
ENV GIT_USER="lopes"
10+
ENV GIT_REPO="netbox-scanner"
911
ENV GIT_COMMIT="438016caea3e975ce2cae34c443d661ee7b66b20"
10-
ENV GIT_ARCHIVE="https://github.com/lopes/netbox-scanner/archive/$GIT_COMMIT.tar.gz"
12+
ENV GIT_ARCHIVE="https://github.com/$GIT_USER/$GIT_REPO/archive/$GIT_COMMIT.tar.gz"
1113

1214
# Install packages
1315
RUN apt-get update \
@@ -17,11 +19,12 @@ RUN apt-get update \
1719
# Copy root filesystem
1820
COPY rootfs /
1921

20-
# install netbox-scanner
22+
# Download source
23+
WORKDIR /$GIT_REPO
2124
ADD $GIT_ARCHIVE /
22-
WORKDIR /netbox-scanner
23-
RUN tar xzvf /$GIT_COMMIT.tar.gz
24-
WORKDIR /netbox-scanner/netbox-scanner-$GIT_COMMIT
25+
RUN tar --strip-component 1 -xzvf /$GIT_COMMIT.tar.gz && rm /$GIT_COMMIT.tar.gz
26+
27+
# Install dependencies
2528
RUN pip3 install -r requirements.txt
2629

2730
# Cleanup

rootfs/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ echo 'a9ebfa600ece03fb0005080c3b1184dfe52cea87 /root/.netbox-scanner.conf' | sh
77

88
echo 'Netbox-scanner running..'
99

10-
exec python3 /netbox-scanner/netbox-scanner-438016caea3e975ce2cae34c443d661ee7b66b20/netbox-scanner/nbscanner
10+
exec python3 /netbox-scanner/netbox-scanner/nbscanner

0 commit comments

Comments
 (0)