Skip to content

Commit e83323b

Browse files
authored
Merge pull request #396 from neo4j/fix/python-cleanup
Cleanup Python package
2 parents cc067aa + 1c13e43 commit e83323b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

neo4j-admin/Dockerfile

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG IMAGE
22
FROM golang:1.22-bullseye as build
3-
RUN apt-get update && apt-get install -y curl && apt-get remove -y python* && apt-get autoremove -y
3+
RUN apt-get update && apt-get install -y curl && apt-get remove -y python* && apt-get autoremove -y && apt-get clean
44
WORKDIR backup
55
COPY backup/aws aws/
66
COPY backup/azure azure/
@@ -17,10 +17,14 @@ FROM ${IMAGE} as final
1717
ARG DISTRIBUTION
1818
RUN \
1919
if [ "${DISTRIBUTION}" = "debian" ]; then \
20-
apt-get update && apt-get install -y bash netcat-openbsd curl wget gnupg apt-transport-https apt-utils lsb-release unzip less && rm -rf /var/lib/apt/lists/* ; \
20+
apt-get update && apt-get install -y bash netcat-openbsd curl wget gnupg apt-transport-https apt-utils lsb-release unzip less && \
21+
apt-get remove -y python* && apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* ; \
2122
else \
2223
#for redhat
23-
microdnf update -y && microdnf install -y bash nc wget gnupg yum-utils unzip less ; \
24+
microdnf update -y && microdnf install -y bash nc wget gnupg yum-utils unzip less && \
25+
# Safely remove python packages without affecting protected packages
26+
microdnf remove -y python3 python3-pip python2 python2-pip --exclude=dnf,libdnf --nobest || true && \
27+
microdnf clean all ; \
2428
fi
2529
COPY --from=build /go/backup/backup_linux bin/backup
2630
ENV NEO4J_server_config_strict__validation_enabled=false

0 commit comments

Comments
 (0)