Skip to content

Commit d4f4ffa

Browse files
committed
alpine base image
1 parent f555f2a commit d4f4ffa

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

Dockerfile

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

33
ARG GIT_USER="lopes"
44
ARG GIT_REPO="netbox-scanner"
@@ -33,22 +33,17 @@ ENV PATH="$VIRTUAL_ENV/bin:$PATH"
3333
RUN pip3 install --no-cache-dir -r requirements.txt
3434

3535
# Build image
36-
FROM debian:12-slim as build
36+
FROM alpine:3 as build
3737

38-
ARG PACKAGES="nmap python3"
38+
# sha256sum --> coreutils
39+
ARG PACKAGES="nmap python3 bash coreutils"
3940

40-
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
41-
42-
# Install packages
43-
ARG DEBIAN_FRONTEND=noninteractive
44-
RUN apt-get update \
45-
&& apt-get -y upgrade \
46-
&& apt-get -y install $PACKAGES \
47-
&& rm -rf /var/lib/apt/lists/*
41+
RUN apk upgrade --no-cache \
42+
&& apk add --no-cache $PACKAGES
4843

4944
# Copy necessary files
5045
COPY rootfs/run.sh /
51-
COPY --from=netbox /netbox-scanner /netbox-scanner
46+
COPY --from=netbox-scanner /netbox-scanner /netbox-scanner
5247

5348
# Build final image
5449
FROM scratch

0 commit comments

Comments
 (0)