Skip to content

Commit aa7d5aa

Browse files
committed
Update dockerfile build: new python base image, reduce disk space use
Use newest python:3-alpine. Remove sphinxcontrib libraries and xapian docs that were left around from the build saving 2M.
1 parent c60d98f commit aa7d5aa

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

scripts/Docker/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ ARG source=local
2727
ARG pythonversion=3.11
2828

2929
#FROM python:3-alpine
30-
FROM python@sha256:0a56f24afa1fc7f518aa690cb8c7be661225e40b157d9bb8c6ef402164d9faa7 as build
30+
FROM python@sha256:603975e62d85aa07578034d3d10ffa1983b7618a6abb6371cf51941be6b8842c as build
3131

3232
# Inherit global values https://github.com/moby/moby/issues/37345
3333
ARG appdir
@@ -97,7 +97,8 @@ RUN [ -z "${VERBOSE}" ] || set -xv; \
9797
./configure --prefix=/usr/local --with-python3 --disable-documentation && \
9898
make && make install && \
9999
pip uninstall --no-cache-dir -y sphinx && \
100-
pip uninstall --no-cache-dir -y -r $CWD/sphinxdeps.txt
100+
pip uninstall --no-cache-dir -y -r $CWD/sphinxdeps.txt && \
101+
rm -rf /usr/local/share/doc/xapian-bindings
101102

102103
# add requirements for pip here, e.g. Whoosh, gpg, zstd or other
103104
# modules not installed in the base library.
@@ -157,7 +158,7 @@ RUN if [ -n "$pip_mod" ]; then pip install --no-cache-dir ${pip_mod}; fi
157158
# build a new smaller docker image for execution. Build image above
158159
# is 1G in size.
159160
# FROM python:3-alpine
160-
FROM python@sha256:0a56f24afa1fc7f518aa690cb8c7be661225e40b157d9bb8c6ef402164d9faa7
161+
FROM python@sha256:603975e62d85aa07578034d3d10ffa1983b7618a6abb6371cf51941be6b8842c
161162

162163
# import from global
163164
ARG appdir
@@ -212,8 +213,7 @@ ARG pythonversion
212213
COPY --from=build /usr/local/lib/python${pythonversion}/site-packages /usr/local/lib/python${pythonversion}/site-packages/
213214
COPY --from=build /usr/local/bin/roundup* /usr/local/bin/
214215
COPY --from=build /usr/local/share /usr/local/share/
215-
COPY scripts/Docker/roundup_start .
216-
COPY scripts/Docker/roundup_healthcheck .
216+
COPY scripts/Docker/roundup_start scripts/Docker/roundup_healthcheck ./
217217

218218
# Do not run roundup as root. This creates roundup user and group.
219219
ARG roundup_uid

scripts/Docker/sphinxdeps.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ pyparsing
1313
requests
1414
six
1515
snowballstemmer
16+
sphinxcontrib-applehelp
17+
sphinxcontrib-devhelp
18+
sphinxcontrib-htmlhelp
19+
sphinxcontrib-jsmath
20+
sphinxcontrib-qthelp
1621
sphinxcontrib-serializinghtml
1722
sphinxcontrib-websupport
1823
urllib3

0 commit comments

Comments
 (0)