Skip to content

Commit f19db0c

Browse files
committed
Optimize base docker image size
1 parent 0380e83 commit f19db0c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

DockerfileBase

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ LABEL com.abhinavsingh.name="abhinavsingh/proxy.py" \
1414
org.opencontainers.image.vendor="Abhinav Singh"
1515

1616
ENV PYTHONUNBUFFERED 1
17+
ENV PYTHONDONTWRITEBYTECODE 1
1718

1819
# Install paramiko and cryptography to allow
1920
# users to use tunneling features using Docker
@@ -28,10 +29,13 @@ RUN apk update && apk --no-cache add \
2829
rust \
2930
make
3031
RUN python -m venv /proxy/venv && \
31-
/proxy/venv/bin/pip install --no-cache-dir \
32+
/proxy/venv/bin/pip install --no-compile --no-cache-dir \
3233
-U pip wheel && \
33-
/proxy/venv/bin/pip install --no-cache-dir \
34+
/proxy/venv/bin/pip install --no-compile --no-cache-dir \
3435
paramiko==3.4.0 \
3536
cryptography==39.0.1 \
36-
--prefer-binary
37-
RUN apk del .builddeps
37+
--prefer-binary && \
38+
apk del .builddeps && \
39+
find . -type d -name '__pycache__' | xargs rm -rf && \
40+
rm -rf /var/cache/apk/* && \
41+
rm -rf /root/.cache/

0 commit comments

Comments
 (0)