Remove redundant chown; read only version.

This commit is contained in:
Adam Outler
2025-11-17 20:45:52 +00:00
parent 7d5dcf061c
commit abc3e71440
2 changed files with 11 additions and 6 deletions

View File

@@ -148,12 +148,11 @@ COPY --from=builder --chown=20212:20212 ${VIRTUAL_ENV} ${VIRTUAL_ENV}
# although it may be quicker to do it before the copy, it keeps the image
# layers smaller to do it after.
RUN if [ -f .VERSION ]; then \
cp .VERSION ${NETALERTX_APP}/.VERSION && \
chown ${NETALERTX_USER}:${NETALERTX_GROUP} ${NETALERTX_APP}/.VERSION; \
cp .VERSION ${NETALERTX_APP}/.VERSION; \
else \
echo "DEVELOPMENT $(cd /app && git rev-parse --short HEAD 2>/dev/null || echo '00000000')" > ${NETALERTX_APP}/.VERSION && \
chown ${NETALERTX_USER}:${NETALERTX_GROUP} ${NETALERTX_APP}/.VERSION; \
echo "DEVELOPMENT $(cd /app && git rev-parse --short HEAD 2>/dev/null || echo '00000000')" > ${NETALERTX_APP}/.VERSION; \
fi && \
chown ${READ_ONLY_USER}:${READ_ONLY_GROUP} ${NETALERTX_APP}/.VERSION && \
apk add libcap && \
setcap cap_net_raw+ep /bin/busybox && \
setcap cap_net_raw,cap_net_admin+eip /usr/bin/nmap && \