Skip to content

Commit 4692f7e

Browse files
nichtsfreiTehforsch
authored andcommitted
Add: pypsrp-cli into container
1 parent 3760796 commit 4692f7e

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

.docker/prod.Dockerfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,31 @@ COPY --from=build /install /install
155155
COPY --from=rs-binaries /install/usr/local/bin/openvasd /install/usr/local/bin/openvasd
156156
COPY --from=rs-binaries /install/usr/local/bin/scannerctl /install/usr/local/bin/scannerctl
157157

158+
FROM ${FINAL_IMAGE} AS pypsrp-cli-build
159+
ARG VERSION
160+
RUN if ! printf '%s' "${VERSION}" | grep -q -- '-edge$'; then \
161+
suite_name="${VERSION}"; \
162+
if [ "${suite_name}" = "latest" ]; then suite_name=stable; fi; \
163+
. /etc/os-release && sed -i "s/${suite_name}/$VERSION_CODENAME/g" /etc/apt/sources.list.d/*.sources; \
164+
fi
165+
RUN apt-get update \
166+
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --no-install-suggests -y \
167+
gcc \
168+
git \
169+
krb5-user \
170+
libkrb5-dev \
171+
python3 \
172+
python3-cryptography \
173+
python3-dev \
174+
python3-gssapi \
175+
python3-pip \
176+
python3-requests \
177+
&& rm -rf /var/lib/apt/lists/*
178+
RUN git clone --depth 1 https://github.com/greenbone/pypsrp-cli.git /tmp/pypsrp-cli \
179+
&& python3 -m pip install --break-system-packages --no-cache-dir --root /install /tmp/pypsrp-cli \
180+
&& test -x /install/usr/local/bin/pypsrp-cli \
181+
&& rm -rf /tmp/pypsrp-cli
182+
158183
FROM ${FINAL_IMAGE}
159184
ARG VERSION
160185
ARG FINAL_PACKAGE_SET
@@ -169,12 +194,19 @@ RUN if ! printf '%s' "${VERSION}" | grep -q -- '-edge$'; then \
169194
RUN test -f "/tmp/openvas-packages/${FINAL_PACKAGE_SET}.txt" \
170195
&& apt-get update \
171196
&& xargs -a "/tmp/openvas-packages/${FINAL_PACKAGE_SET}.txt" apt-get install --no-install-recommends --no-install-suggests -y \
197+
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --no-install-suggests -y \
198+
krb5-user \
199+
python3 \
200+
python3-cryptography \
201+
python3-gssapi \
202+
python3-requests \
172203
&& rm -rf /var/lib/apt/lists/*
173204

174205
# must be pre built within the rust dir and moved to the bin dir
175206
# usually this image is created within in a ci ensuring that the
176207
# binary is available.
177208
COPY --from=prepared /install/ /
209+
COPY --from=pypsrp-cli-build /install/usr/local/ /usr/local/
178210
COPY --from=openvas-smb /usr/local/lib/ /usr/local/lib/
179211
COPY --from=openvas-smb /usr/local/bin/ /usr/local/bin/
180212
RUN ldconfig

0 commit comments

Comments
 (0)